summaryrefslogtreecommitdiff
path: root/src/test/lib/tests/test_duplicate.sail
blob: 99ffbe6c78f63f56b581b5c3612eee2b7e375245 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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);
}