Simplified Evaluate function
This commit is contained in:
20
tests/programs/for.q
Normal file
20
tests/programs/for.q
Normal file
@ -0,0 +1,20 @@
|
||||
main() {
|
||||
total := 0
|
||||
|
||||
for 0..10 {
|
||||
total += 1
|
||||
}
|
||||
|
||||
assert total == 10
|
||||
|
||||
for 0..total {
|
||||
total -= 1
|
||||
}
|
||||
|
||||
assert total == 5
|
||||
|
||||
for i := 0..10 {
|
||||
assert i >= 0
|
||||
assert i < 10
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
main() {
|
||||
x := 0
|
||||
|
||||
for 0..5 {
|
||||
x += 1
|
||||
}
|
||||
|
||||
assert x == 5
|
||||
|
||||
for i := 0..5 {
|
||||
assert i >= 0
|
||||
assert i < 5
|
||||
}
|
||||
}
|
@ -60,7 +60,7 @@ var programs = []struct {
|
||||
{"switch", 0},
|
||||
{"loop-infinite", 0},
|
||||
{"loop-lifetime", 0},
|
||||
{"loop-for", 0},
|
||||
{"for", 0},
|
||||
{"memory-free", 0},
|
||||
{"out-of-memory", 0},
|
||||
{"index-static", 0},
|
||||
|
Reference in New Issue
Block a user