v2 / vlib / v / tests / aliases / numeric_alias_empty_init_test.v
12 lines · 10 sloc · 304 bytes · 4be7ab216ddefec124eaa79c11e45413b7fca294
Raw
1type Decimal = f64
2type Counter = int
3
4fn test_empty_init_of_numeric_aliases() {
5 decimal_zero := Decimal{}
6 counter_zero := Counter{}
7
8 assert typeof(decimal_zero).name == 'Decimal'
9 assert typeof(counter_zero).name == 'Counter'
10 assert decimal_zero == Decimal(0.0)
11 assert counter_zero == Counter(0)
12}
13