@@ -149,6 +149,21 @@ class ExpressionEvaluationSuite extends FunSuite {
149
149
checkEvaluation(In (Literal (1 ), Seq (Literal (1 ), Literal (2 ))) && In (Literal (2 ), Seq (Literal (1 ), Literal (2 ))), true )
150
150
}
151
151
152
+ test(" Divide" ) {
153
+ checkEvaluation(Divide (Literal (2 ), Literal (1 )), 2 )
154
+ checkEvaluation(Divide (Literal (1.0 ), Literal (2.0 )), 0.5 )
155
+ checkEvaluation(Divide (Literal (1 ), Literal (2 )), 0 )
156
+ checkEvaluation(Divide (Literal (1 ), Literal (0 )), null )
157
+ checkEvaluation(Divide (Literal (1.0 ), Literal (0.0 )), null )
158
+ checkEvaluation(Divide (Literal (0.0 ), Literal (0.0 )), null )
159
+ checkEvaluation(Divide (Literal (0 ), Literal (null , IntegerType )), null )
160
+ checkEvaluation(Divide (Literal (1 ), Literal (null , IntegerType )), null )
161
+ checkEvaluation(Divide (Literal (null , IntegerType ), Literal (0 )), null )
162
+ checkEvaluation(Divide (Literal (null , DoubleType ), Literal (0.0 )), null )
163
+ checkEvaluation(Divide (Literal (null , IntegerType ), Literal (1 )), null )
164
+ checkEvaluation(Divide (Literal (null , IntegerType ), Literal (null , IntegerType )), null )
165
+ }
166
+
152
167
test(" INSET" ) {
153
168
val hS = HashSet [Any ]() + 1 + 2
154
169
val nS = HashSet [Any ]() + 1 + 2 + null
0 commit comments