Add failing boolean operator test
This commit is contained in:
parent
2566ebc7d0
commit
ddc5b8e36d
16
src/test/contracts/boolean_operators.mligo
Normal file
16
src/test/contracts/boolean_operators.mligo
Normal file
@ -0,0 +1,16 @@
|
||||
// Test CameLIGO boolean operators
|
||||
|
||||
let or_true (b : bool) : bool =
|
||||
b or True
|
||||
|
||||
let or_false (b : bool) : bool =
|
||||
b or False
|
||||
|
||||
let and_true (b : bool) : bool =
|
||||
b and True
|
||||
|
||||
let and_false (b : bool) : bool =
|
||||
b and False
|
||||
|
||||
let not_bool (b: bool) : bool =
|
||||
not b
|
@ -163,6 +163,19 @@ let bool_expression () : unit result =
|
||||
] in
|
||||
ok ()
|
||||
|
||||
let bool_expression_mligo () : unit result =
|
||||
let%bind program = mtype_file "./contracts/boolean_operators.mligo" in
|
||||
let%bind _ =
|
||||
let aux (name, f) = expect_eq_b_bool program name f in
|
||||
bind_map_list aux [
|
||||
("or_true", fun b -> b || true) ;
|
||||
("or_false", fun b -> b || false) ;
|
||||
("and_true", fun b -> b && true) ;
|
||||
("and_false", fun b -> b && false) ;
|
||||
("not_bool", fun b -> not b) ;
|
||||
] in
|
||||
ok ()
|
||||
|
||||
let arithmetic () : unit result =
|
||||
let%bind program = type_file "./contracts/arithmetic.ligo" in
|
||||
let%bind _ =
|
||||
@ -941,6 +954,7 @@ let main = test_suite "Integration (End to End)" [
|
||||
test "annotation" annotation ;
|
||||
test "multiple parameters" multiple_parameters ;
|
||||
test "bool" bool_expression ;
|
||||
test "bool (mligo)" bool_expression_mligo ;
|
||||
test "arithmetic" arithmetic ;
|
||||
test "arithmetic (mligo)" arithmetic_mligo ;
|
||||
test "bitiwse_arithmetic" bitwise_arithmetic ;
|
||||
|
Loading…
Reference in New Issue
Block a user