Fixed incorrect division results
This commit is contained in:
parent
65b74046e1
commit
a75aad52f6
11 changed files with 150 additions and 94 deletions
30
tests/programs/operator-assign.q
Normal file
30
tests/programs/operator-assign.q
Normal file
|
@ -0,0 +1,30 @@
|
|||
main() {
|
||||
number(10)
|
||||
register(10)
|
||||
}
|
||||
|
||||
number(x int) {
|
||||
y := x
|
||||
x -= 1
|
||||
assert x < y
|
||||
x += 1
|
||||
assert x == y
|
||||
x *= 2
|
||||
assert x > y
|
||||
x /= 2
|
||||
assert x == y
|
||||
}
|
||||
|
||||
register(x int) {
|
||||
y := x
|
||||
num := 1
|
||||
x -= num
|
||||
assert x < y
|
||||
x += num
|
||||
assert x == y
|
||||
num = 2
|
||||
x *= num
|
||||
assert x > y
|
||||
x /= num
|
||||
assert x == y
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue