diff --git a/dune b/dune index b664be0..87f6af6 100644 --- a/dune +++ b/dune @@ -10,7 +10,6 @@ (test (name rule110) (modules rule110) - (enabled_if %{arch_sixtyfour}) (libraries hashcons)) (test diff --git a/dune-project b/dune-project index 3382b0d..d346151 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,3 @@ (lang dune 2.7) (name hashcons) +(formatting (enabled_for dune)) diff --git a/hashcons.opam b/hashcons.opam index 1b6d8ee..3c9d300 100644 --- a/hashcons.opam +++ b/hashcons.opam @@ -14,7 +14,7 @@ homepage: "https://github.com/backtracking/ocaml-hashcons" bug-reports: "https://github.com/backtracking/ocaml-hashcons/issues" depends: [ "dune" {>= "2.7"} - "ocaml" {>= "4.07"} + "ocaml" {>= "4.12"} "odoc" {with-doc} ] build: [ diff --git a/rule110.ml b/rule110.ml index 3ae2fec..2c953a2 100644 --- a/rule110.ml +++ b/rule110.ml @@ -196,13 +196,15 @@ let of_string s = (* a few tests *) -let test s n b = - let c = of_string s in - let c = steps n c in - assert (bits c = b) -let () = test "0000000000000000" 1 0 -let () = test "1111111111111111" 1 3 -let () = test "0010000001010100" 0 4 -let () = test "0100011101011100" 1000 595 -let () = test "1010100010111101" 1000000 591649 -let () = test "1010100010111101" 1152921504606846975 682111393702695301 +let test ?(size=32) s n b = + if Sys.word_size >= size then ( + let c = of_string s in + let c = steps (int_of_string n) c in + assert (bits c = int_of_string b) + ) +let () = test "0000000000000000" "1" "0" +let () = test "1111111111111111" "1" "3" +let () = test "0010000001010100" "0" "4" +let () = test "0100011101011100" "1000" "595" +let () = test "1010100010111101" "1000000" "591649" +let () = test ~size:64 "1010100010111101" "1152921504606846975" "682111393702695301"