Skip to content

Commit 31e20a6

Browse files
committed
update tests
1 parent ac2071f commit 31e20a6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

evaluator/evaluator_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ func TestEvalIntegerExpression(t *testing.T) {
2222
{"5 + 5 + 5 + 5 - 10", 10},
2323
{"2 * 2 * 2 * 2", 16},
2424
{"2 / 2 + 1", 2},
25-
{"2**3", 8},
2625
}
2726

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

33+
func TestEvalFloatExpression(t *testing.T) {
34+
tests := []struct {
35+
input string
36+
expected float64
37+
}{
38+
{"2**3", 8.0},
39+
}
40+
41+
for _, tt := range tests {
42+
evaluated := testEval(tt.input)
43+
testFloatObject(t, evaluated, tt.expected)
44+
}
45+
}
46+
3447
func TestEvalBooleanExpression(t *testing.T) {
3548
tests := []struct {
3649
input string

0 commit comments

Comments
 (0)