Fixed incorrect division results
This commit is contained in:
@ -14,58 +14,56 @@ import (
|
||||
|
||||
var programs = []struct {
|
||||
Name string
|
||||
Input string
|
||||
Output string
|
||||
ExitCode int
|
||||
}{
|
||||
{"empty", "", "", 0},
|
||||
{"assert", "", "", 1},
|
||||
{"variables", "", "", 0},
|
||||
{"reassign", "", "", 0},
|
||||
{"reuse", "", "", 0},
|
||||
{"return", "", "", 0},
|
||||
{"return-multi", "", "", 0},
|
||||
{"math", "", "", 0},
|
||||
{"precedence", "", "", 0},
|
||||
{"op-assign", "", "", 0},
|
||||
{"binary", "", "", 0},
|
||||
{"octal", "", "", 0},
|
||||
{"hexadecimal", "", "", 0},
|
||||
{"const", "", "", 0},
|
||||
{"escape-rune", "", "", 0},
|
||||
{"escape-string", "", "", 0},
|
||||
{"bitwise-and", "", "", 0},
|
||||
{"bitwise-or", "", "", 0},
|
||||
{"bitwise-xor", "", "", 0},
|
||||
{"shift", "", "", 0},
|
||||
{"modulo", "", "", 0},
|
||||
{"modulo-assign", "", "", 0},
|
||||
{"div-split", "", "", 0},
|
||||
{"int64", "", "", 0},
|
||||
{"negative", "", "", 0},
|
||||
{"negation", "", "", 0},
|
||||
{"square-sum", "", "", 0},
|
||||
{"chained-calls", "", "", 0},
|
||||
{"nested-calls", "", "", 0},
|
||||
{"param", "", "", 0},
|
||||
{"param-multi", "", "", 0},
|
||||
{"param-order", "", "", 0},
|
||||
{"branch", "", "", 0},
|
||||
{"branch-and", "", "", 0},
|
||||
{"branch-or", "", "", 0},
|
||||
{"branch-both", "", "", 0},
|
||||
{"branch-save", "", "", 0},
|
||||
{"jump-near", "", "", 0},
|
||||
{"switch", "", "", 0},
|
||||
{"loop-infinite", "", "", 0},
|
||||
{"loop-lifetime", "", "", 0},
|
||||
{"loop-for", "", "", 0},
|
||||
{"memory-free", "", "", 0},
|
||||
{"out-of-memory", "", "", 0},
|
||||
{"index-static", "", "", 0},
|
||||
{"index-dynamic", "", "", 0},
|
||||
{"struct", "", "", 0},
|
||||
{"len", "", "", 0},
|
||||
{"empty", 0},
|
||||
{"assert", 1},
|
||||
{"binary", 0},
|
||||
{"octal", 0},
|
||||
{"hexadecimal", 0},
|
||||
{"variables", 0},
|
||||
{"reassign", 0},
|
||||
{"reuse", 0},
|
||||
{"return", 0},
|
||||
{"return-multi", 0},
|
||||
{"math", 0},
|
||||
{"precedence", 0},
|
||||
{"operator-assign", 0},
|
||||
{"const", 0},
|
||||
{"escape-rune", 0},
|
||||
{"escape-string", 0},
|
||||
{"bitwise-and", 0},
|
||||
{"bitwise-or", 0},
|
||||
{"bitwise-xor", 0},
|
||||
{"shift", 0},
|
||||
{"modulo", 0},
|
||||
{"modulo-assign", 0},
|
||||
{"div-split", 0},
|
||||
{"int64", 0},
|
||||
{"negative", 0},
|
||||
{"negation", 0},
|
||||
{"square-sum", 0},
|
||||
{"chained-calls", 0},
|
||||
{"nested-calls", 0},
|
||||
{"param", 0},
|
||||
{"param-multi", 0},
|
||||
{"param-order", 0},
|
||||
{"branch", 0},
|
||||
{"branch-and", 0},
|
||||
{"branch-or", 0},
|
||||
{"branch-both", 0},
|
||||
{"branch-save", 0},
|
||||
{"jump-near", 0},
|
||||
{"switch", 0},
|
||||
{"loop-infinite", 0},
|
||||
{"loop-lifetime", 0},
|
||||
{"loop-for", 0},
|
||||
{"memory-free", 0},
|
||||
{"out-of-memory", 0},
|
||||
{"index-static", 0},
|
||||
{"index-dynamic", 0},
|
||||
{"struct", 0},
|
||||
{"len", 0},
|
||||
}
|
||||
|
||||
func TestPrograms(t *testing.T) {
|
||||
@ -74,12 +72,12 @@ func TestPrograms(t *testing.T) {
|
||||
|
||||
t.Run(test.Name+"/debug", func(t *testing.T) {
|
||||
config.Optimize(false)
|
||||
run(t, file, "debug", test.Input, test.Output, test.ExitCode)
|
||||
run(t, file, "debug", "", "", test.ExitCode)
|
||||
})
|
||||
|
||||
t.Run(test.Name+"/release", func(t *testing.T) {
|
||||
config.Optimize(true)
|
||||
run(t, file, "release", test.Input, test.Output, test.ExitCode)
|
||||
run(t, file, "release", "", "", test.ExitCode)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user