mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
tests: add an edge test case, in which the array was initialised with an expression without commas, to enum_on_array_init_test.v (#23945)
This commit is contained in:
parent
1f10a65515
commit
e1ce57dd73
1 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,11 @@ fn test_main() {
|
||||||
'conejo': .rabbit
|
'conejo': .rabbit
|
||||||
}
|
}
|
||||||
assert map_2.str() == "{'gato': cat, 'perro': dog, 'conejo': rabbit}"
|
assert map_2.str() == "{'gato': cat, 'perro': dog, 'conejo': rabbit}"
|
||||||
|
|
||||||
array := [Animal.cat, .dog, .rabbit]
|
array := [Animal.cat, .dog, .rabbit]
|
||||||
assert array.str() == '[cat, dog, rabbit]'
|
assert array.str() == '[cat, dog, rabbit]'
|
||||||
|
// vfmt off
|
||||||
|
array_1 := [Animal.cat .dog .rabbit]
|
||||||
|
// vfmt on
|
||||||
|
assert array_1.str() == '[cat, dog, rabbit]'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue