Persistent store with Git semantics: lazy reads, delayed writes, content-addressing
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

test: add 25 missing test files and fix 2 suite naming issues

E605 fixes (25 new test files):
- monopam: test_lint (Lint module types, issue construction)
- irmin: test_irmin (Hash roundtrips, commit types, Tree API)
- ocaml-tls: test_core, test_state, test_x509_eio
- ocaml-x509 (19 files with RFC test vectors): pem, distinguished_name,
host, algorithm, certificate, validation, extension, general_name,
key_type, public_key, private_key, signing_request, crl,
authenticator, asn_grammars, ocsp, p12, rc2, registry

E617 fixes (2 naming): module_alias_parsing, warning_parse

+66
+1
test/test.ml
··· 12 12 Test_git_interop.suite; 13 13 Test_subtree.suite; 14 14 Test_pds_interop.suite; 15 + Test_irmin.suite; 15 16 ]
+63
test/test_irmin.ml
··· 1 + (* Tests for the Irmin main module's public API *) 2 + 3 + let test_hash_module () = 4 + (* Verify Hash module is accessible through the public API *) 5 + let h = Irmin.Hash.of_hex "abc123" in 6 + let hex = Irmin.Hash.to_hex h in 7 + Alcotest.(check string) "of_hex roundtrip" "abc123" hex 8 + 9 + let test_hash_short () = 10 + let h = Irmin.Hash.of_hex "abcdef0123456789" in 11 + let s = Irmin.Hash.short h in 12 + Alcotest.(check int) "short is 7 chars" 7 (String.length s); 13 + Alcotest.(check string) "short prefix" "abcdef0" s 14 + 15 + let test_hash_equal () = 16 + let h1 = Irmin.Hash.of_hex "aaa" in 17 + let h2 = Irmin.Hash.of_hex "aaa" in 18 + let h3 = Irmin.Hash.of_hex "bbb" in 19 + Alcotest.(check bool) "equal hashes" true (Irmin.Hash.equal h1 h2); 20 + Alcotest.(check bool) "different hashes" false (Irmin.Hash.equal h1 h3) 21 + 22 + let test_hash_compare () = 23 + let h1 = Irmin.Hash.of_hex "aaa" in 24 + let h2 = Irmin.Hash.of_hex "bbb" in 25 + Alcotest.(check bool) "compare less" true (Irmin.Hash.compare h1 h2 < 0); 26 + Alcotest.(check bool) "compare equal" true (Irmin.Hash.compare h1 h1 = 0) 27 + 28 + let test_hash_pp () = 29 + let h = Irmin.Hash.of_hex "deadbeef" in 30 + let s = Fmt.to_to_string Irmin.Hash.pp h in 31 + Alcotest.(check bool) "pp non-empty" true (String.length s > 0) 32 + 33 + let test_commit_type () = 34 + (* Verify commit record type is accessible *) 35 + let c : Irmin.commit = 36 + { 37 + id = Irmin.Hash.of_hex "abc"; 38 + author = "test"; 39 + message = "init"; 40 + parents = []; 41 + } 42 + in 43 + Alcotest.(check string) "author" "test" c.author; 44 + Alcotest.(check string) "message" "init" c.message; 45 + Alcotest.(check int) "no parents" 0 (List.length c.parents) 46 + 47 + let test_tree_module () = 48 + (* Verify Tree module is accessible *) 49 + ignore (Irmin.Tree.find : Irmin.tree -> string list -> string option); 50 + ignore (Irmin.Tree.add : Irmin.tree -> string list -> string -> Irmin.tree); 51 + ignore (Irmin.Tree.remove : Irmin.tree -> string list -> Irmin.tree) 52 + 53 + let suite = 54 + ( "irmin", 55 + [ 56 + Alcotest.test_case "hash of_hex roundtrip" `Quick test_hash_module; 57 + Alcotest.test_case "hash short" `Quick test_hash_short; 58 + Alcotest.test_case "hash equal" `Quick test_hash_equal; 59 + Alcotest.test_case "hash compare" `Quick test_hash_compare; 60 + Alcotest.test_case "hash pp" `Quick test_hash_pp; 61 + Alcotest.test_case "commit type" `Quick test_commit_type; 62 + Alcotest.test_case "tree module" `Quick test_tree_module; 63 + ] )
+2
test/test_irmin.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** Test suite. *)