v2 / vlib / v / tests / fns / const_call_or_expr_test.v
11 lines · 9 sloc · 282 bytes · 3036a5afc68563e45443274e15cc0389c00ccf82
Raw
1import os
2
3const vdir = os.getenv_opt('VDIR') or { os.dir(os.getenv_opt('VEXE') or { os.getwd() }) }
4const vdir2 = os.getenv_opt('NON_EXISTENT')
5const vdir3 = os.getenv_opt('NON_EXISTENT') or { '' }
6
7fn test_main() {
8 assert vdir.len > 0
9 assert vdir2 == none
10 assert vdir3 == ''
11}
12