diff --git a/evaluator/evaluator_test.go b/evaluator/evaluator_test.go index ad9e925..452f552 100644 --- a/evaluator/evaluator_test.go +++ b/evaluator/evaluator_test.go @@ -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 { @@ -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