Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AvicennaJr committed Nov 2, 2023
1 parent ac2071f commit 31e20a6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion evaluator/evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func TestEvalIntegerExpression(t *testing.T) {
{"5 + 5 + 5 + 5 - 10", 10},
{"2 * 2 * 2 * 2", 16},
{"2 / 2 + 1", 2},
{"2**3", 8},
}

for _, tt := range tests {
Expand All @@ -31,6 +30,20 @@ func TestEvalIntegerExpression(t *testing.T) {
}
}

func TestEvalFloatExpression(t *testing.T) {
tests := []struct {
input string
expected float64
}{
{"2**3", 8.0},
}

for _, tt := range tests {
evaluated := testEval(tt.input)
testFloatObject(t, evaluated, tt.expected)
}
}

func TestEvalBooleanExpression(t *testing.T) {
tests := []struct {
input string
Expand Down

0 comments on commit 31e20a6

Please sign in to comment.