Monorepo management for opam overlays
0
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

+53
+1
test/test.ml
··· 40 40 Test_sync_progress.suite; 41 41 Test_verse.suite; 42 42 Test_verse_registry.suite; 43 + Test_lint.suite; 43 44 ]
+50
test/test_lint.ml
··· 1 + (* Tests for the Lint module *) 2 + 3 + (* The Lint module's run function requires Eio filesystem access. 4 + We test the pure types and their construction here. *) 5 + 6 + let test_kind_values () = 7 + (* Verify that the kind type constructors are accessible *) 8 + let missing = Monopam.Lint.Missing in 9 + let unused = Monopam.Lint.Unused in 10 + Alcotest.(check bool) "kinds are distinct" true (missing <> unused) 11 + 12 + let test_issue_construction () = 13 + let issue : Monopam.Lint.issue = 14 + { subtree = "my-pkg"; kind = Missing; package = "fmt" } 15 + in 16 + Alcotest.(check string) "subtree" "my-pkg" issue.subtree; 17 + Alcotest.(check string) "package" "fmt" issue.package; 18 + Alcotest.(check bool) 19 + "kind is Missing" true 20 + (issue.kind = Monopam.Lint.Missing) 21 + 22 + let test_result_construction () = 23 + let r : Monopam.Lint.result = { issues = []; packages_scanned = 0 } in 24 + Alcotest.(check int) "no issues" 0 (List.length r.issues); 25 + Alcotest.(check int) "no packages" 0 r.packages_scanned 26 + 27 + let test_result_with_issues () = 28 + let issues : Monopam.Lint.issue list = 29 + [ 30 + { subtree = "a"; kind = Missing; package = "x" }; 31 + { subtree = "b"; kind = Unused; package = "y" }; 32 + ] 33 + in 34 + let r : Monopam.Lint.result = { issues; packages_scanned = 2 } in 35 + Alcotest.(check int) "two issues" 2 (List.length r.issues); 36 + Alcotest.(check int) "two packages" 2 r.packages_scanned 37 + 38 + let test_run_type () = 39 + (* Verify the run function type signature is accessible *) 40 + ignore (Monopam.Lint.run : fs:_ -> monorepo:_ -> unit -> Monopam.Lint.result) 41 + 42 + let suite = 43 + ( "lint", 44 + [ 45 + Alcotest.test_case "kind values" `Quick test_kind_values; 46 + Alcotest.test_case "issue construction" `Quick test_issue_construction; 47 + Alcotest.test_case "result construction" `Quick test_result_construction; 48 + Alcotest.test_case "result with issues" `Quick test_result_with_issues; 49 + Alcotest.test_case "run type" `Quick test_run_type; 50 + ] )
+2
test/test_lint.mli
··· 1 + val suite : string * unit Alcotest.test_case list 2 + (** Test suite. *)