summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_duplicate.sail
diff options
context:
space:
mode:
authorRobert Norton2017-07-19 18:08:02 +0100
committerRobert Norton2017-07-19 18:08:02 +0100
commit632b10c0d4b01dc1af8593b8ae1f088fbfd9e342 (patch)
treeac566808213125670da5f4dc3d702fe663333f7e /src/test/lib/tests/test_duplicate.sail
parentd8969b1f9631dc15d5fb6b3b33a4a69dbfb7358a (diff)
split library tests into separate files to avoid risk of sail compiler stack overflow.
Diffstat (limited to 'src/test/lib/tests/test_duplicate.sail')
-rw-r--r--src/test/lib/tests/test_duplicate.sail14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/lib/tests/test_duplicate.sail b/src/test/lib/tests/test_duplicate.sail
new file mode 100644
index 00000000..99ffbe6c
--- /dev/null
+++ b/src/test/lib/tests/test_duplicate.sail
@@ -0,0 +1,14 @@
+function unit test () = {
+ (* XXX crashes on shallow embedding
+ should type have a constraint n>0?
+ test_assert ("duplicate_empty", (bitzero ^^ 0) == []); *)
+ test_assert ("duplicate0", (bitzero ^^ 8) == 0x00);
+ test_assert ("duplicate1", (bitone ^^ 8) == 0xff);
+
+ (* XXX crashes on shallow embedding
+ test_assert ("duplicate_bits0", (0x21 ^^ 0) == []);*)
+ test_assert ("duplicate_bits1", (0xce ^^ 1) == 0xce);
+ test_assert ("duplicate_bits9", (0xce ^^ 9) == 0xcecececececececece);
+ test_assert ("duplicate_covfefe", (0xc0 : (0xfe ^^ 2)) == 0xc0fefe);
+}
+