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.

irmin/test: extract Alcotest.run into per-subdir test.ml

Merlint E600 expects Alcotest.run to live in test.ml (the runner),
not in test_*.ml modules (which should only export a [suite]).

For each new per-lib test dir (admin, cbor, gzip, json, mime, oci,
text, toml, ui, yaml) split the runner out:

- test_irmin_<X>.ml keeps the spec tests; just [let suite = ...]
- test.ml one-liner: Alcotest.run "Irmin_<X>" [suite]
- dune (test (name test)) points at the new runner

For ui/, which has seven per-component test files, test.ml runs all
suites together.

Also shorten long identifier names (E320) — parse_manifest_has_
exactly_these_members -> parse_manifest_members, etc.

+48 -67
+1 -1
test/admin/dune
··· 1 1 (test 2 - (name test_irmin_admin) 2 + (name test) 3 3 (libraries irmin_admin alcotest))
+1
test/admin/test.ml
··· 1 + let () = Alcotest.run "Irmin_admin" [ Test_irmin_admin.suite ]
-2
test/admin/test_irmin_admin.ml
··· 120 120 Alcotest.test_case "is_allowed case-sensitive" `Quick 121 121 is_allowed_case_sensitive; 122 122 ] ) 123 - 124 - let () = Alcotest.run "Irmin_admin" [ suite ]
+1 -1
test/cbor/dune
··· 1 1 (test 2 - (name test_irmin_cbor) 2 + (name test) 3 3 (libraries irmin irmin_cbor cbor alcotest))
+1
test/cbor/test.ml
··· 1 + let () = Alcotest.run "Irmin_cbor" [ Test_irmin_cbor.suite ]
-2
test/cbor/test_irmin_cbor.ml
··· 108 108 roundtrip_map_shape_preserved; 109 109 Alcotest.test_case "schema name" `Quick schema_name_is_application_cbor; 110 110 ] ) 111 - 112 - let () = Alcotest.run "Irmin_cbor" [ suite ]
+1 -1
test/gzip/dune
··· 1 1 (test 2 - (name test_irmin_gzip) 2 + (name test) 3 3 (libraries irmin irmin_gzip irmin_json alcotest digestif))
+1
test/gzip/test.ml
··· 1 + let () = Alcotest.run "Irmin_gzip" [ Test_irmin_gzip.suite ]
-2
test/gzip/test_irmin_gzip.ml
··· 70 70 Alcotest.test_case "malformed rejected" `Quick malformed_rejected; 71 71 Alcotest.test_case "wrap json roundtrip" `Quick wrapped_json_roundtrip; 72 72 ] ) 73 - 74 - let () = Alcotest.run "Irmin_gzip" [ suite ]
+1 -1
test/json/dune
··· 1 1 (test 2 - (name test_irmin_json) 2 + (name test) 3 3 (libraries irmin irmin_json alcotest digestif))
+1
test/json/test.ml
··· 1 + let () = Alcotest.run "Irmin_json" [ Test_irmin_json.suite ]
-2
test/json/test_irmin_json.ml
··· 118 118 Alcotest.test_case "schema name" `Quick schema_is_named_application_json; 119 119 Alcotest.test_case "schema MIME" `Quick schema_advertises_mime; 120 120 ] ) 121 - 122 - let () = Alcotest.run "Irmin_json" [ suite ]
+1 -1
test/mime/dune
··· 1 1 (test 2 - (name test_irmin_mime) 2 + (name test) 3 3 (libraries irmin irmin_mime alcotest))
+1
test/mime/test.ml
··· 1 + let () = Alcotest.run "Irmin_mime" [ Test_irmin_mime.suite ]
-2
test/mime/test_irmin_mime.ml
··· 43 43 Alcotest.test_case "rules include all built-in codecs" `Quick 44 44 rules_include_all_declared_mimes; 45 45 ] ) 46 - 47 - let () = Alcotest.run "Irmin_mime" [ suite ]
+1 -1
test/oci/dune
··· 1 1 (test 2 - (name test_irmin_oci) 2 + (name test) 3 3 (libraries irmin irmin_oci alcotest))
+1
test/oci/test.ml
··· 1 + let () = Alcotest.run "Irmin_oci" [ Test_irmin_oci.suite ]
+5 -7
test/oci/test_irmin_oci.ml
··· 13 13 let expected_manifest_members = 14 14 [ "config"; "layers"; "mediaType"; "schemaVersion" ] 15 15 16 - let parse_manifest_has_exactly_these_members () = 16 + let parse_manifest_members () = 17 17 match Irmin_oci.parse sample_manifest with 18 18 | Irmin.SHA256.Named kids -> 19 19 let names = List.map fst kids |> List.sort String.compare in 20 20 Alcotest.(check (list string)) 21 21 "manifest members" expected_manifest_members names 22 - | _ -> Alcotest.fail "parse_manifest_has_exactly_these_members" 22 + | _ -> Alcotest.fail "parse_manifest_members" 23 23 24 - let parse_manifest_values_are_inline_json () = 24 + let parse_manifest_inline_json () = 25 25 match Irmin_oci.parse sample_manifest with 26 26 | Irmin.SHA256.Named kids -> 27 27 List.iter ··· 61 61 ( "irmin_oci", 62 62 [ 63 63 Alcotest.test_case "parse manifest exposes exactly its members" `Quick 64 - parse_manifest_has_exactly_these_members; 64 + parse_manifest_members; 65 65 Alcotest.test_case "manifest values are inline JSON bytes" `Quick 66 - parse_manifest_values_are_inline_json; 66 + parse_manifest_inline_json; 67 67 Alcotest.test_case "parse array -> Indexed with right length" `Quick 68 68 parse_array_length; 69 69 Alcotest.test_case "parse invalid -> Named []" `Quick ··· 73 73 Alcotest.test_case "schema name is OCI manifest MIME" `Quick 74 74 schema_has_oci_mime_name; 75 75 ] ) 76 - 77 - let () = Alcotest.run "Irmin_oci" [ suite ]
+1 -1
test/text/dune
··· 1 1 (test 2 - (name test_irmin_text) 2 + (name test) 3 3 (libraries irmin irmin_text alcotest))
+1
test/text/test.ml
··· 1 + let () = Alcotest.run "Irmin_text" [ Test_irmin_text.suite ]
+4 -6
test/text/test_irmin_text.ml
··· 16 16 (Fmt.str "%s mime" expected_name) 17 17 (Some expected_name) (Irmin.SHA256.mime codec) 18 18 19 - let plain_is_named_and_has_mime () = name_and_mime Irmin_text.plain "text/plain" 19 + let plain_named_mime () = name_and_mime Irmin_text.plain "text/plain" 20 20 21 - let markdown_is_named_and_has_mime () = 21 + let markdown_named_mime () = 22 22 name_and_mime Irmin_text.markdown "text/markdown" 23 23 24 24 let suite = 25 25 ( "irmin_text", 26 26 [ 27 27 Alcotest.test_case "plain name and MIME" `Quick 28 - plain_is_named_and_has_mime; 28 + plain_named_mime; 29 29 Alcotest.test_case "markdown name and MIME" `Quick 30 - markdown_is_named_and_has_mime; 30 + markdown_named_mime; 31 31 ] ) 32 - 33 - let () = Alcotest.run "Irmin_text" [ suite ]
+1 -1
test/toml/dune
··· 1 1 (test 2 - (name test_irmin_toml) 2 + (name test) 3 3 (libraries irmin irmin_toml alcotest))
+1
test/toml/test.ml
··· 1 + let () = Alcotest.run "Irmin_toml" [ Test_irmin_toml.suite ]
-2
test/toml/test_irmin_toml.ml
··· 70 70 roundtrip_preserves_names; 71 71 Alcotest.test_case "schema name" `Quick schema_name_is_application_toml; 72 72 ] ) 73 - 74 - let () = Alcotest.run "Irmin_toml" [ suite ]
+2 -9
test/ui/dune
··· 1 - (tests 2 - (names 3 - test_brand 4 - test_breadcrumb 5 - test_button 6 - test_drop_zone 7 - test_layout 8 - test_table 9 - test_tag) 1 + (test 2 + (name test) 10 3 (libraries irmin_ui tw.html alcotest astring))
+11
test/ui/test.ml
··· 1 + let () = 2 + Alcotest.run "Irmin_ui" 3 + [ 4 + Test_brand.suite; 5 + Test_breadcrumb.suite; 6 + Test_button.suite; 7 + Test_drop_zone.suite; 8 + Test_layout.suite; 9 + Test_table.suite; 10 + Test_tag.suite; 11 + ]
-2
test/ui/test_brand.ml
··· 37 37 Alcotest.test_case "logo embeds an accessible SVG" `Quick 38 38 logo_embeds_accessible_svg; 39 39 ] ) 40 - 41 - let () = Alcotest.run "Brand" [ suite ]
-2
test/ui/test_breadcrumb.ml
··· 61 61 hrefs_are_emitted_verbatim; 62 62 Alcotest.test_case "no segments -> no anchors" `Quick empty_has_no_anchors; 63 63 ] ) 64 - 65 - let () = Alcotest.run "Breadcrumb" [ suite ]
+2 -4
test/ui/test_button.ml
··· 41 41 "label text" true 42 42 (Astring.String.is_infix ~affix:"Sign in" s) 43 43 44 - let primary_and_secondary_are_visually_distinct () = 44 + let primary_secondary_distinct () = 45 45 let p = Tw_html.to_string (Button.primary [ Tw_html.txt "x" ]) in 46 46 let s = Tw_html.to_string (Button.secondary [ Tw_html.txt "x" ]) in 47 47 Alcotest.(check bool) "different style output" true (not (String.equal p s)) ··· 56 56 Alcotest.test_case "link_primary renders an anchor with href" `Quick 57 57 link_primary_renders_anchor; 58 58 Alcotest.test_case "primary and secondary differ visually" `Quick 59 - primary_and_secondary_are_visually_distinct; 59 + primary_secondary_distinct; 60 60 ] ) 61 - 62 - let () = Alcotest.run "Button" [ suite ]
+2 -4
test/ui/test_drop_zone.ml
··· 38 38 "value=target" true 39 39 (Astring.String.is_infix ~affix:"value=\"docs/src\"" s) 40 40 41 - let file_input_present_with_auto_submit () = 41 + let file_input_auto_submit () = 42 42 let s = form ~upload_url:"/u" ~target_dir:"" in 43 43 Alcotest.(check bool) 44 44 "file input" true ··· 55 55 Alcotest.test_case "hidden dir input carries target_dir" `Quick 56 56 hidden_dir_carries_target; 57 57 Alcotest.test_case "file input auto-submits" `Quick 58 - file_input_present_with_auto_submit; 58 + file_input_auto_submit; 59 59 ] ) 60 - 61 - let () = Alcotest.run "Drop_zone" [ suite ]
-2
test/ui/test_layout.ml
··· 102 102 Alcotest.test_case "summary wraps its text in <p>" `Quick 103 103 summary_is_a_paragraph; 104 104 ] ) 105 - 106 - let () = Alcotest.run "Layout" [ suite ]
+4 -6
test/ui/test_table.ml
··· 18 18 in 19 19 loop 0 0 20 20 21 - let head_has_one_th_per_column () = 21 + let head_one_th_per_column () = 22 22 let h = 23 23 Table.head 24 24 [ ("Name", Table.Left); ("Size", Table.Right); ("Hash", Table.Right) ] ··· 42 42 "cell content" true 43 43 (Astring.String.is_infix ~affix:">x<" s) 44 44 45 - let dim_and_mono_cells_render_text () = 45 + let dim_mono_cells_render () = 46 46 let d = Tw_html.to_string (Table.dim_cell "—") in 47 47 let m = Tw_html.to_string (Table.mono_cell "abcdef0") in 48 48 Alcotest.(check bool) "dim text" true (Astring.String.is_infix ~affix:"—" d); ··· 72 72 ( "table", 73 73 [ 74 74 Alcotest.test_case "head: one <th> per column, all labels visible" `Quick 75 - head_has_one_th_per_column; 75 + head_one_th_per_column; 76 76 Alcotest.test_case "row is a <tr> containing its cells" `Quick row_is_a_tr; 77 77 Alcotest.test_case "dim_cell and mono_cell render distinctly" `Quick 78 - dim_and_mono_cells_render_text; 78 + dim_mono_cells_render; 79 79 Alcotest.test_case "wrap yields a <table> containing head + rows" `Quick 80 80 wrap_produces_table_tag; 81 81 ] ) 82 - 83 - let () = Alcotest.run "Table" [ suite ]
-2
test/ui/test_tag.ml
··· 43 43 tones_are_visually_distinct; 44 44 Alcotest.test_case "mono differs from v" `Quick mono_differs_from_v; 45 45 ] ) 46 - 47 - let () = Alcotest.run "Tag" [ suite ]
+1 -1
test/yaml/dune
··· 1 1 (test 2 - (name test_irmin_yaml) 2 + (name test) 3 3 (libraries irmin irmin_yaml alcotest))
+1
test/yaml/test.ml
··· 1 + let () = Alcotest.run "Irmin_yaml" [ Test_irmin_yaml.suite ]
-2
test/yaml/test_irmin_yaml.ml
··· 60 60 roundtrip_preserves_names; 61 61 Alcotest.test_case "schema name" `Quick schema_name_is_application_yaml; 62 62 ] ) 63 - 64 - let () = Alcotest.run "Irmin_yaml" [ suite ]