summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_duplicate.sail
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-07-26 14:12:09 +0100
committerAlasdair Armstrong2017-07-26 14:12:09 +0100
commit678ab0e23ba4a8d95010df2bd2467dae7d544e29 (patch)
tree0b2e02773327b9483f24b2e1ad46b7235ec9633e /src/test/lib/tests/test_duplicate.sail
parent26e59493cde0ffbf1868426fe3bec158f2dbaad0 (diff)
parent18cf235fad35a0e06e26ea91ee0e1c673febddb8 (diff)
Merge remote-tracking branch 'origin/master' into sail_new_tc
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);
+}
+