Skip to content
Snippets Groups Projects
Commit f9577c37 authored by Orestis Melkonian's avatar Orestis Melkonian
Browse files

Test: Boolean comparison fix

parent 3467a1b5
No related branches found
No related tags found
No related merge requests found
......@@ -289,4 +289,13 @@ public class Main {
pre(with(a[1 - 1], aa -> aa.length == (2 - 1) && (aa[0] == 8)));
post();
}
public static void eq11(boolean b1, boolean b2) {
pre(imp((b1 && b2) == true, b1 == b2));
post();
}
public static void eq12(boolean b1, boolean b2) {
pre();
post();
}
}
......@@ -63,6 +63,7 @@ evalBin :: LConst -> LBinop -> LConst -> LConst
evalBin (CBool x) LAnd (CBool y) = CBool (x && y)
evalBin (CBool x) LOr (CBool y) = CBool (x || y)
evalBin (CBool x) LImpl (CBool y) = CBool (not x || (x && y))
evalBin (CBool x) CEqual (CBool y) = CBool (x == y)
-- Comparison operators
evalBin (CInt x) o (CInt y)
| o `elem` compOps = CBool $ compOpF o x y
......
......@@ -52,4 +52,5 @@ examples =
, "array2d11" .== "array2d12" -- #25 TODO fix test backend
, "array2d21" .!= "array2d22" -- #26 TODO fix test backend
, "arr11" .== "arr12" -- #27 TODO fix test backend
, "eq11" .== "eq12" -- #28
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment