diff options
Diffstat (limited to 'v_windows/v/vlib/v/tests/if_expr_of_multi_stmts_test.v')
-rw-r--r-- | v_windows/v/vlib/v/tests/if_expr_of_multi_stmts_test.v | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/v_windows/v/vlib/v/tests/if_expr_of_multi_stmts_test.v b/v_windows/v/vlib/v/tests/if_expr_of_multi_stmts_test.v new file mode 100644 index 0000000..308db30 --- /dev/null +++ b/v_windows/v/vlib/v/tests/if_expr_of_multi_stmts_test.v @@ -0,0 +1,15 @@ +fn test_if_expr_of_multi_stmts() { + a := 2 + ret := if a > 1 { + mut b := 1 + b *= 10 + println(b) + b + } else { + mut c := 0 + c += 2 + println(c) + c + } + assert ret == 10 +} |