Added assertions to most tests

This commit is contained in:
2024-07-28 18:47:13 +02:00
parent c2c147f1b4
commit 32d7455c38
15 changed files with 86 additions and 266 deletions

View File

@ -18,24 +18,12 @@ var programs = []struct {
ExitCode int
}{
{"empty", "", "", 0},
{"math", "", "", 10},
{"precedence", "", "", 10},
{"square-sum", "", "", 25},
{"chained-calls", "", "", 9},
{"nested-calls", "", "", 4},
{"param", "", "", 3},
{"param-multi", "", "", 21},
{"param-order", "", "", 0},
{"reuse", "", "", 3},
{"return", "", "", 6},
{"reassign", "", "", 2},
{"branch", "", "", 0},
{"branch-and", "", "", 0},
{"branch-or", "", "", 0},
{"branch-both", "", "", 0},
{"jump-near", "", "", 0},
{"loop", "", "", 0},
{"loop-lifetime", "", "", 0},
{"assert", "", "", 1},
{"reuse", "", "", 0},
{"reassign", "", "", 0},
{"return", "", "", 0},
{"math", "", "", 0},
{"precedence", "", "", 0},
{"bitwise-and", "", "", 0},
{"bitwise-or", "", "", 0},
{"bitwise-xor", "", "", 0},
@ -43,9 +31,21 @@ var programs = []struct {
{"modulo", "", "", 0},
{"modulo-assign", "", "", 0},
{"division-split", "", "", 0},
{"assert", "", "", 1},
{"negative", "", "", 32},
{"negation", "", "", 32},
{"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},
{"jump-near", "", "", 0},
{"loop", "", "", 0},
{"loop-lifetime", "", "", 0},
}
func TestPrograms(t *testing.T) {