aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/v/gen/native/tests/ifs.vv
diff options
context:
space:
mode:
Diffstat (limited to 'v_windows/v/old/vlib/v/gen/native/tests/ifs.vv')
-rw-r--r--v_windows/v/old/vlib/v/gen/native/tests/ifs.vv65
1 files changed, 65 insertions, 0 deletions
diff --git a/v_windows/v/old/vlib/v/gen/native/tests/ifs.vv b/v_windows/v/old/vlib/v/gen/native/tests/ifs.vv
new file mode 100644
index 0000000..674d4aa
--- /dev/null
+++ b/v_windows/v/old/vlib/v/gen/native/tests/ifs.vv
@@ -0,0 +1,65 @@
+fn print_number(n int) {
+ if n == 0 {
+ println('print_number')
+ }
+}
+
+fn test_add() {
+ n := 3
+ print_number(0)
+ print_number(1)
+ if n > 1 {
+ println('var(3) > 1')
+ }
+ /*
+ if 1 < n {
+ println('1 < var(3)')
+ }
+ if 1 > n {
+ println('1 > 3 ERROR')
+ }
+ */
+ if 1 < 3 {
+ println('1 < 3')
+ }
+ if 1 == 1 {
+ println('1 == 1')
+ // TODO assert here
+ }
+ if 1 != 3 {
+ println('1 != 3')
+ // TODO assert here
+ }
+ if 3 != 3 {
+ println('3 != 3 ERROR')
+ // TODO assert here
+ }
+ if 1 > 3 {
+ println('1 > 3 ERROR')
+ // TODO assert here
+ }
+}
+
+/*
+fn test_elses() {
+ println('start else')
+ if 1 < 2 {
+ println('ok')
+ } else {
+ println('1<2else ERROR')
+ }
+ if 1 > 2 {
+ println('1<2else ERROR')
+ } else {
+ println('ok')
+ }
+ println('end else')
+}
+*/
+
+fn main() {
+ println('start')
+ test_add()
+ // test_elses()
+ println('end')
+}