We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac2071f commit 31e20a6Copy full SHA for 31e20a6
1 file changed
evaluator/evaluator_test.go
@@ -22,7 +22,6 @@ func TestEvalIntegerExpression(t *testing.T) {
22
{"5 + 5 + 5 + 5 - 10", 10},
23
{"2 * 2 * 2 * 2", 16},
24
{"2 / 2 + 1", 2},
25
- {"2**3", 8},
26
}
27
28
for _, tt := range tests {
@@ -31,6 +30,20 @@ func TestEvalIntegerExpression(t *testing.T) {
31
30
32
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
47
func TestEvalBooleanExpression(t *testing.T) {
48
tests := []struct {
49
input string
0 commit comments