summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-11-27 18:51:37 +0000
committerAlasdair Armstrong2017-11-27 18:51:37 +0000
commit1dcd59b9cb80f879dff96061ba7ee8111dcff0f9 (patch)
tree0556bd49a2b8eb35dfb48d90571d573688b1935c /test
parent4de5d52ee0f525d7c472e8aa3ee2a8158d888148 (diff)
Added test for short-circuiting of boolean operations
Diffstat (limited to 'test')
-rw-r--r--test/ocaml/short_circuit/expect1
-rw-r--r--test/ocaml/short_circuit/sc.sail15
2 files changed, 16 insertions, 0 deletions
diff --git a/test/ocaml/short_circuit/expect b/test/ocaml/short_circuit/expect
new file mode 100644
index 00000000..9766475a
--- /dev/null
+++ b/test/ocaml/short_circuit/expect
@@ -0,0 +1 @@
+ok
diff --git a/test/ocaml/short_circuit/sc.sail b/test/ocaml/short_circuit/sc.sail
new file mode 100644
index 00000000..a0f4941d
--- /dev/null
+++ b/test/ocaml/short_circuit/sc.sail
@@ -0,0 +1,15 @@
+
+val fail : unit -> bool effect {escape}
+
+function fail () = {
+ assert(false);
+ true
+}
+
+val main : unit -> unit effect {escape}
+
+function main () = {
+ assert(~(false & fail()));
+ assert(true | fail());
+ print("ok")
+} \ No newline at end of file