mirage / digestif

Simple hash algorithms in OCaml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test failure with alcotest 1.0.1

vbgl opened this issue · comments

Running the test-suite of digestif-0.8.0 with alcotest-1.0.1 yields the following error:

running tests
   test_conv alias test/conv/runtest (exit 2)
(cd _build/default/test/conv && ./test_conv.exe --color=always)
seed: [|118; 4; 12; 129; 19; 6; 209; 128; 205; 167; 23; 143|].
test_conv.exe: internal error, uncaught exception:
               Alcotest__Core.Registration_error("Duplicate test name: of_hex")

Fatal error: exception Alcotest__Core.Make(M).Test_error
        test alias test/c/runtest

Below is a possible (trivial) fix:

--- a/test/conv/test_conv.ml	2020-04-14 07:05:23.347470133 +0200
+++ b/test/conv/test_conv.ml	2020-04-14 07:06:15.580175419 +0200
@@ -98,12 +98,12 @@
 
 let tests () =
   Alcotest.run "digestif"
-    [ "of_hex", List.mapi test_hex_success consistent_hex
-    ; "consistent_of_hex", List.mapi test_consistent_hex_success consistent_hex
-    ; "of_hex", List.mapi test_hex_success spaces_hex
-    ; "consistent_of_hex", List.mapi test_consistent_hex_success spaces_hex
-    ; "of_hex", List.mapi test_hex_success inconsistent_hex
-    ; "consistent_of_hex", List.mapi test_consistent_hex_fail inconsistent_hex
+    [ "of_hex 1", List.mapi test_hex_success consistent_hex
+    ; "consistent_of_hex 1", List.mapi test_consistent_hex_success consistent_hex
+    ; "of_hex 2", List.mapi test_hex_success spaces_hex
+    ; "consistent_of_hex 2", List.mapi test_consistent_hex_success spaces_hex
+    ; "of_hex 3", List.mapi test_hex_success inconsistent_hex
+    ; "consistent_of_hex 3", List.mapi test_consistent_hex_fail inconsistent_hex
     ; ( "iso of_hex"
       , List.mapi test_hex_iso
           (list_init (random_string Digestif.SHA1.digest_size) 64) )

Thanks! Fixed with #95