@@ -112,12 +112,12 @@ class InterpreterTest extends CatsEffectSuite with ScalaCheckEffectSuite:
112
112
val divisionWithX = eval(" -4*(x+3*4-2*2)" )
113
113
114
114
(expr, division).mapN((x, y) => assert(x == y)) >>
115
- (division, multiplication).mapN((x, y) => assert(x == y)) >>
116
- (multiplication, addition).mapN((x, y) => assert(x == y)) >>
117
- (addition, subtraction).mapN((x, y) => assert(x == y)) >>
118
- (subtraction, answer).mapN((x, y) => assert(x == y)) >>
119
- (exprWithX, answer).mapN((x, y) => assert(x == y)) >>
120
- (divisionWithX, answer).mapN((x, y) => assert(x == y))
115
+ (division, multiplication).mapN((x, y) => assert(x == y)) >>
116
+ (multiplication, addition).mapN((x, y) => assert(x == y)) >>
117
+ (addition, subtraction).mapN((x, y) => assert(x == y)) >>
118
+ (subtraction, answer).mapN((x, y) => assert(x == y)) >>
119
+ (exprWithX, answer).mapN((x, y) => assert(x == y)) >>
120
+ (divisionWithX, answer).mapN((x, y) => assert(x == y))
121
121
122
122
test(" division by zero error" ):
123
123
evaluate(Expr .Divide (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, 0 )))
@@ -127,14 +127,14 @@ class InterpreterTest extends CatsEffectSuite with ScalaCheckEffectSuite:
127
127
test(" logical or" ):
128
128
evaluate(Expr .Or (empty, Expr .Literal (empty, true ), Expr .Literal (empty, false )))
129
129
.map(x => assert(x == true )) >>
130
- evaluate(Expr .Or (empty, Expr .Literal (empty, false ), Expr .Literal (empty, false )))
131
- .map(x => assert(x == false ))
130
+ evaluate(Expr .Or (empty, Expr .Literal (empty, false ), Expr .Literal (empty, false )))
131
+ .map(x => assert(x == false ))
132
132
133
133
test(" logical and" ):
134
134
evaluate(Expr .And (empty, Expr .Literal (empty, true ), Expr .Literal (empty, false )))
135
135
.map(x => assert(x == false )) >>
136
- evaluate(Expr .And (empty, Expr .Literal (empty, false ), Expr .Literal (empty, false )))
137
- .map(x => assert(x == false ))
136
+ evaluate(Expr .And (empty, Expr .Literal (empty, false ), Expr .Literal (empty, false )))
137
+ .map(x => assert(x == false ))
138
138
139
139
test(" must be numbers or strings runtime error" ):
140
140
evaluate(Expr .Add (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
@@ -153,21 +153,21 @@ class InterpreterTest extends CatsEffectSuite with ScalaCheckEffectSuite:
153
153
evaluate(Expr .Subtract (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
154
154
.attempt
155
155
.map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
156
- evaluate(Expr .Divide (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
157
- .attempt
158
- .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
159
- evaluate(Expr .Multiply (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
160
- .attempt
161
- .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
162
- evaluate(Expr .Greater (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
163
- .attempt
164
- .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
165
- evaluate(Expr .GreaterEqual (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
166
- .attempt
167
- .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
168
- evaluate(Expr .Less (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
169
- .attempt
170
- .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
171
- evaluate(Expr .LessEqual (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
172
- .attempt
173
- .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty))))
156
+ evaluate(Expr .Divide (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
157
+ .attempt
158
+ .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
159
+ evaluate(Expr .Multiply (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
160
+ .attempt
161
+ .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
162
+ evaluate(Expr .Greater (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
163
+ .attempt
164
+ .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
165
+ evaluate(Expr .GreaterEqual (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
166
+ .attempt
167
+ .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
168
+ evaluate(Expr .Less (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
169
+ .attempt
170
+ .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty)))) >>
171
+ evaluate(Expr .LessEqual (empty, Expr .Literal (empty, 1 ), Expr .Literal (empty, " string" )))
172
+ .attempt
173
+ .map(x => assert(x == Left (RuntimeError .MustBeNumbers (empty))))
0 commit comments