From 31e20a6ac36826221478f07c3d1c402e029b44cb Mon Sep 17 00:00:00 2001 From: AvicennaJr Date: Thu, 2 Nov 2023 22:33:50 +0300 Subject: [PATCH] update tests --- evaluator/evaluator_test.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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