diff --git a/otherlibs/dune-build-info/test/run.t b/otherlibs/dune-build-info/test/run.t old mode 100755 new mode 100644 index b83081602d8..91b2ce55968 --- a/otherlibs/dune-build-info/test/run.t +++ b/otherlibs/dune-build-info/test/run.t @@ -132,7 +132,7 @@ craft an example with a single placeholder to make the output stable: $ dune build d/d.install $ dune install d --prefix _install --debug-artifact-substitution Found placeholder in _build/install/default/bin/d: - - placeholder: Vcs_describe In_source_tree "d" + - placeholder: Vcs_describe (In_source_tree "d") - evaluates to: "1.0+d" Test substitution when promoting diff --git a/otherlibs/dyn/dyn.ml b/otherlibs/dyn/dyn.ml index e06b2f872f3..b9a22524f57 100644 --- a/otherlibs/dyn/dyn.ml +++ b/otherlibs/dyn/dyn.ml @@ -68,12 +68,14 @@ let pp_sequence start stop x ~f = let sep = ";" ^ String.make (String.length start) ' ' in Pp.hvbox (Pp.concat_mapi ~sep:Pp.cut x ~f:(fun i x -> - Pp.box ((if i = 0 then Pp.verbatim (start ^ " ") else Pp.verbatim sep) ++ f x)) + Pp.box + ~indent:2 + ((if i = 0 then Pp.verbatim (start ^ " ") else Pp.verbatim sep) ++ f x)) ++ Pp.space ++ Pp.verbatim stop) ;; -let rec pp = +let rec pp ?(in_arg = false) = let open Pp.O in function | Opaque -> Pp.verbatim "" @@ -87,8 +89,8 @@ let rec pp = | Bytes b -> string_in_ocaml_syntax (Bytes.to_string b) | Char c -> Pp.char c | Float f -> Pp.verbatim (string_of_float f) - | Option None -> pp (Variant ("None", [])) - | Option (Some x) -> pp (Variant ("Some", [ x ])) + | Option None -> pp ~in_arg (Variant ("None", [])) + | Option (Some x) -> pp ~in_arg (Variant ("Some", [ x ])) | List xs -> pp_sequence "[" "]" xs ~f:pp | Array xs -> pp_sequence "[|" "|]" (Array.to_list xs) ~f:pp | Set xs -> @@ -100,25 +102,25 @@ let rec pp = ++ Pp.space ++ pp_sequence "{" "}" xs ~f:(fun (k, v) -> Pp.box ~indent:2 (pp k ++ Pp.space ++ Pp.char ':' ++ Pp.space ++ pp v))) - | Tuple x -> - Pp.box - (Pp.char '(' - ++ Pp.concat_map ~sep:(Pp.seq (Pp.char ',') Pp.space) x ~f:pp - ++ Pp.char ')') + | Tuple xs -> + Pp.char '(' + ++ Pp.hvbox (Pp.concat_map ~sep:(Pp.seq (Pp.char ',') Pp.space) xs ~f:pp) + ++ Pp.char ')' | Record fields -> pp_sequence "{" "}" fields ~f:(fun (f, v) -> Pp.box ~indent:2 (Pp.verbatim f ++ Pp.space ++ Pp.char '=' ++ Pp.space ++ pp v)) | Variant (v, []) -> Pp.verbatim v - | Variant (v, xs) -> - Pp.hvbox - ~indent:2 - (Pp.concat - [ Pp.verbatim v - ; Pp.space - ; Pp.concat_map ~sep:(Pp.seq (Pp.char ',') Pp.space) xs ~f:pp - ]) + | Variant (v, (_ :: _ as xs)) -> + let arg = + match xs with + | [ x ] -> x + | _ -> Tuple xs + in + let app = Pp.hvbox ~indent:2 (Pp.verbatim v ++ Pp.space ++ pp ~in_arg:true arg) in + if in_arg then Pp.char '(' ++ app ++ Pp.char ')' else app ;; +let pp t = pp t let to_string t = Format.asprintf "%a" Pp.to_fmt (pp t) type 'a builder = 'a -> t diff --git a/otherlibs/ocamlc-loc/test/ocamlc_loc_tests.ml b/otherlibs/ocamlc-loc/test/ocamlc_loc_tests.ml index 7b6d6363e6d..10070c42498 100644 --- a/otherlibs/ocamlc-loc/test/ocamlc_loc_tests.ml +++ b/otherlibs/ocamlc-loc/test/ocamlc_loc_tests.ml @@ -64,7 +64,7 @@ Error (warning 32 [unused-value-declaration]): unused value foo. { loc = { path = "test.ml"; line = Single 1; chars = Some (4, 7) } ; message = "unused value foo." ; related = [] - ; severity = Error Some { code = 32; name = "unused-value-declaration" } + ; severity = Error (Some { code = 32; name = "unused-value-declaration" }) } |}] ;; @@ -98,9 +98,9 @@ Error: The implementation test.ml does not match the interface test.cmi: The type bool is not compatible with the type int" ; related = [ ({ path = "test.mli"; line = Single 1; chars = Some (0, 11) }, - "Expected declaration") + "Expected declaration") ; ({ path = "test.ml"; line = Single 1; chars = Some (4, 5) }, - "Actual declaration") + "Actual declaration") ] ; severity = Error None } |}] @@ -169,7 +169,7 @@ Error: Signature mismatch: [%expect {| >> error 0 - { loc = { path = "test.ml"; line = Range 3, 5; chars = Some (6, 3) } + { loc = { path = "test.ml"; line = Range (3, 5); chars = Some (6, 3) } ; message = "Signature mismatch:\n\ Modules do not match:\n\ @@ -184,9 +184,9 @@ Error: Signature mismatch: Type float is not compatible with type int" ; related = [ ({ path = "test.ml"; line = Single 2; chars = Some (2, 20) }, - "Expected declaration") + "Expected declaration") ; ({ path = "test.ml"; line = Single 4; chars = Some (6, 7) }, - "Actual declaration") + "Actual declaration") ] ; severity = Error None } |}] @@ -242,12 +242,12 @@ Error: The implementation src/dune_rules/artifacts.ml ; line = Single 20 ; chars = Some (4, 33) }, - "Expected declaration") + "Expected declaration") ; ({ path = "src/dune_rules/artifacts.ml" ; line = Single 50 ; chars = Some (8, 13) }, - "Actual declaration") + "Actual declaration") ] ; severity = Error None } |}] @@ -280,7 +280,7 @@ Will be removed past 2020-20-20. Use Mylib.Intf_only instead. "module Bar\n\ Will be removed past 2020-20-20. Use Mylib.Bar instead." ; related = [] - ; severity = Error Some "deprecated" + ; severity = Error (Some "deprecated") } >> error 1 { loc = { path = "fooexe.ml"; line = Single 4; chars = Some (0, 7) } @@ -288,7 +288,7 @@ Will be removed past 2020-20-20. Use Mylib.Intf_only instead. "module Foo\n\ Will be removed past 2020-20-20. Use Mylib.Foo instead." ; related = [] - ; severity = Error Some "deprecated" + ; severity = Error (Some "deprecated") } >> error 2 { loc = { path = "fooexe.ml"; line = Single 7; chars = Some (11, 22) } @@ -296,7 +296,7 @@ Will be removed past 2020-20-20. Use Mylib.Intf_only instead. "module Intf_only\n\ Will be removed past 2020-20-20. Use Mylib.Intf_only instead." ; related = [] - ; severity = Error Some "deprecated" + ; severity = Error (Some "deprecated") } |}] ;; @@ -315,7 +315,7 @@ Error: Some record fields are undefined: signal_watcher >> error 0 { loc = { path = "test/expect-tests/timer_tests.ml" - ; line = Range 6, 10 + ; line = Range (6, 10) ; chars = Some (2, 3) } ; message = "Some record fields are undefined: signal_watcher" @@ -387,7 +387,7 @@ Error: The implementation src/dune_engine/build_system.ml ; line = Single 8 ; chars = Some (0, 40) }, - "Expected declaration") + "Expected declaration") ] ; severity = Error None } |}] @@ -503,7 +503,7 @@ testing ; message = "A.f\n\ testing" ; related = [] - ; severity = Error Some "foobar" + ; severity = Error (Some "foobar") } |}] ;; @@ -572,7 +572,7 @@ Case >> error 0 { loc = { path = "src/dune_engine/action.ml" - ; line = Range 34, 96 + ; line = Range (34, 96) ; chars = Some (4, 64) } ; message = @@ -580,12 +580,12 @@ Case Here is an example of a case that is not matched:\n\ Case" ; related = [] - ; severity = Error Some { code = 8; name = "partial-match" } + ; severity = Error (Some { code = 8; name = "partial-match" }) } >> error 1 { loc = { path = "src/dune_engine/action.ml" - ; line = Range 291, 315 + ; line = Range (291, 315) ; chars = Some (2, 22) } ; message = @@ -593,12 +593,12 @@ Case Here is an example of a case that is not matched:\n\ Case" ; related = [] - ; severity = Error Some { code = 8; name = "partial-match" } + ; severity = Error (Some { code = 8; name = "partial-match" }) } >> error 2 { loc = { path = "src/dune_engine/action.ml" - ; line = Range 339, 363 + ; line = Range (339, 363) ; chars = Some (21, 24) } ; message = @@ -606,12 +606,12 @@ Case Here is an example of a case that is not matched:\n\ Case" ; related = [] - ; severity = Error Some { code = 8; name = "partial-match" } + ; severity = Error (Some { code = 8; name = "partial-match" }) } >> error 3 { loc = { path = "src/dune_engine/action.ml" - ; line = Range 391, 414 + ; line = Range (391, 414) ; chars = Some (4, 70) } ; message = @@ -619,7 +619,7 @@ Case Here is an example of a case that is not matched:\n\ Case" ; related = [] - ; severity = Error Some { code = 8; name = "partial-match" } + ; severity = Error (Some { code = 8; name = "partial-match" }) } |}] ;; diff --git a/otherlibs/stdune/test/ansi_color_tests.ml b/otherlibs/stdune/test/ansi_color_tests.ml index 4e99445e9ca..540a4eb0325 100644 --- a/otherlibs/stdune/test/ansi_color_tests.ml +++ b/otherlibs/stdune/test/ansi_color_tests.ml @@ -53,48 +53,60 @@ let%expect_test "reproduce #2664" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Nop, - Tag [ Fg_blue ], Verbatim "1", - Tag [ Fg_blue ], Verbatim "2", - Tag [ Fg_blue ], Verbatim "3", - Tag [ Fg_blue ], Verbatim "4", - Tag [ Fg_blue ], Verbatim "5", - Tag [ Fg_blue ], Verbatim "6", - Tag [ Fg_blue ], Verbatim "7", - Tag [ Fg_blue ], Verbatim "8", - Tag [ Fg_blue ], Verbatim "9", - Tag [ Fg_blue ], Verbatim "10", - Tag [ Fg_blue ], Verbatim "11", - Tag [ Fg_blue ], Verbatim "12", - Tag [ Fg_blue ], Verbatim "13", - Tag [ Fg_blue ], Verbatim "14", - Tag [ Fg_blue ], Verbatim "15", - Tag [ Fg_blue ], Verbatim "16", - Tag [ Fg_blue ], Verbatim "17", - Tag [ Fg_blue ], Verbatim "18", - Tag [ Fg_blue ], Verbatim "19", - Tag [ Fg_blue ], Verbatim "20" |}] + (0, + Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Nop, + Tag + ([ Fg_blue ], + Verbatim + "1")), + Tag + ([ Fg_blue ], + Verbatim "2")), + Tag + ([ Fg_blue ], + Verbatim "3")), + Tag + ([ Fg_blue ], + Verbatim "4")), + Tag + ([ Fg_blue ], + Verbatim "5")), + Tag + ([ Fg_blue ], Verbatim "6")), + Tag ([ Fg_blue ], Verbatim "7")), + Tag ([ Fg_blue ], Verbatim "8")), + Tag ([ Fg_blue ], Verbatim "9")), + Tag ([ Fg_blue ], Verbatim "10")), + Tag ([ Fg_blue ], Verbatim "11")), + Tag ([ Fg_blue ], Verbatim "12")), + Tag ([ Fg_blue ], Verbatim "13")), + Tag ([ Fg_blue ], Verbatim "14")), + Tag ([ Fg_blue ], Verbatim "15")), + Tag ([ Fg_blue ], Verbatim "16")), + Tag ([ Fg_blue ], Verbatim "17")), + Tag ([ Fg_blue ], Verbatim "18")), + Tag ([ Fg_blue ], Verbatim "19")), + Tag ([ Fg_blue ], Verbatim "20"))) |}] ;; let%expect_test "Ansi_color.strip" = @@ -129,30 +141,30 @@ let%expect_test "parse fg and bg colors" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq Nop, Verbatim "This is a ", - Tag [ Fg_blue ], Verbatim "blue", - Verbatim " string with ", - Tag [ Fg_red ], Verbatim "red", - Verbatim " and ", - Tag [ Fg_green ], Verbatim "green", - Verbatim " together with strings of a ", - Tag [ Bg_blue ], Verbatim "blue blackground", - Verbatim " and ", - Tag [ Bg_red ], Verbatim "red background", - Verbatim " and ", - Tag [ Bg_green ], Verbatim "green background" |}] + (0, + Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq (Nop, Verbatim "This is a "), + Tag ([ Fg_blue ], Verbatim "blue")), + Verbatim " string with "), + Tag ([ Fg_red ], Verbatim "red")), + Verbatim " and "), + Tag ([ Fg_green ], Verbatim "green")), + Verbatim " together with strings of a "), + Tag ([ Bg_blue ], Verbatim "blue blackground")), + Verbatim " and "), + Tag ([ Bg_red ], Verbatim "red background")), + Verbatim " and "), + Tag ([ Bg_green ], Verbatim "green background"))) |}] ;; let%expect_test "parse multiple fg and bg colors" = @@ -167,14 +179,18 @@ let%expect_test "parse multiple fg and bg colors" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq Nop, Verbatim "This text is ", - Tag [ Fg_blue; Bg_red ], Verbatim "blue string with a red background", - Verbatim " and ", - Tag [ Fg_green; Bg_blue ], Verbatim "green string with a blue background" |}] + (0, + Seq + (Seq + (Seq + (Seq (Nop, Verbatim "This text is "), + Tag + ([ Fg_blue; Bg_red ], + Verbatim "blue string with a red background")), + Verbatim " and "), + Tag + ([ Fg_green; Bg_blue ], + Verbatim "green string with a blue background"))) |}] ;; let%expect_test "fg default overrides" = @@ -189,14 +205,14 @@ let%expect_test "fg default overrides" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq Nop, Verbatim "This text has a ", - Tag [ Fg_blue ], Verbatim "blue foreground", - Verbatim " but here it becomes the default foreground,", - Verbatim " even together with another foreground modifier." |}] + (0, + Seq + (Seq + (Seq + (Seq (Nop, Verbatim "This text has a "), + Tag ([ Fg_blue ], Verbatim "blue foreground")), + Verbatim " but here it becomes the default foreground,"), + Verbatim " even together with another foreground modifier.")) |}] ;; let%expect_test "bg default overrides" = @@ -211,14 +227,14 @@ let%expect_test "bg default overrides" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq Nop, Verbatim "This text has a ", - Tag [ Bg_blue ], Verbatim "blue background", - Verbatim " but here it becomes the default background,", - Verbatim " even together with another background modifier." |}] + (0, + Seq + (Seq + (Seq + (Seq (Nop, Verbatim "This text has a "), + Tag ([ Bg_blue ], Verbatim "blue background")), + Verbatim " but here it becomes the default background,"), + Verbatim " even together with another background modifier.")) |}] ;; let%expect_test "parse 8-bit colors" = @@ -235,30 +251,31 @@ let%expect_test "parse 8-bit colors" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq Nop, Verbatim "This is a ", - Tag [ Fg_8_bit_color 33 ], Verbatim "blue", - Verbatim " string with ", - Tag [ Fg_8_bit_color 196 ], Verbatim "red", - Verbatim " and ", - Tag [ Fg_8_bit_color 46 ], Verbatim "green", - Verbatim " together with strings of a ", - Tag [ Bg_8_bit_color 33 ], Verbatim "blue blackground", - Verbatim " and ", - Tag [ Bg_8_bit_color 196 ], Verbatim "red background", - Verbatim " and ", - Tag [ Bg_8_bit_color 46 ], Verbatim "green background" |}] + (0, + Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq (Nop, Verbatim "This is a "), + Tag + ([ Fg_8_bit_color 33 ], Verbatim "blue")), + Verbatim " string with "), + Tag ([ Fg_8_bit_color 196 ], Verbatim "red")), + Verbatim " and "), + Tag ([ Fg_8_bit_color 46 ], Verbatim "green")), + Verbatim " together with strings of a "), + Tag ([ Bg_8_bit_color 33 ], Verbatim "blue blackground")), + Verbatim " and "), + Tag ([ Bg_8_bit_color 196 ], Verbatim "red background")), + Verbatim " and "), + Tag ([ Bg_8_bit_color 46 ], Verbatim "green background"))) |}] ;; let%expect_test "parse 24-bit colors" = @@ -275,33 +292,38 @@ let%expect_test "parse 24-bit colors" = [%expect {| Vbox - 0, - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq - Seq Nop, Verbatim "This is a ", + (0, + Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq + (Seq (Nop, Verbatim "This is a "), + Tag + ([ Fg_24_bit_color [ 255; 0; 0 ] ], + Verbatim "blue")), + Verbatim " string with "), + Tag + ([ Fg_24_bit_color [ 0; 255; 0 ] ], + Verbatim "red")), + Verbatim " and "), Tag - [ Fg_24_bit_color [ 255; 0; 0 ] ], - Verbatim "blue", - Verbatim " string with ", - Tag [ Fg_24_bit_color [ 0; 255; 0 ] ], Verbatim "red", - Verbatim " and ", - Tag [ Fg_24_bit_color [ 0; 0; 255 ] ], Verbatim "green", - Verbatim " together with strings of a ", + ([ Fg_24_bit_color [ 0; 0; 255 ] ], + Verbatim "green")), + Verbatim " together with strings of a "), + Tag + ([ Bg_24_bit_color [ 255; 0; 0 ] ], + Verbatim "blue blackground")), + Verbatim " and "), Tag - [ Bg_24_bit_color [ 255; 0; 0 ] ], - Verbatim "blue blackground", - Verbatim " and ", - Tag [ Bg_24_bit_color [ 0; 255; 0 ] ], Verbatim "red background", - Verbatim " and ", - Tag [ Bg_24_bit_color [ 0; 0; 255 ] ], Verbatim "green background" + ([ Bg_24_bit_color [ 0; 255; 0 ] ], Verbatim "red background")), + Verbatim " and "), + Tag ([ Bg_24_bit_color [ 0; 0; 255 ] ], Verbatim "green background"))) |}] ;; diff --git a/otherlibs/stdune/test/path_tests.ml b/otherlibs/stdune/test/path_tests.ml index 27b9d915138..c8db7d45e61 100644 --- a/otherlibs/stdune/test/path_tests.ml +++ b/otherlibs/stdune/test/path_tests.ml @@ -43,7 +43,7 @@ let%expect_test _ = let p = Path.(relative root) "foo" in descendant p ~of_:p; [%expect {| - Some In_source_tree "." + Some (In_source_tree ".") |}] ;; @@ -149,21 +149,21 @@ false let%expect_test _ = descendant (r "foo") ~of_:(r "foo/"); [%expect {| -Some In_source_tree "." +Some (In_source_tree ".") |}] ;; let%expect_test _ = descendant (r "foo/") ~of_:(r "foo"); [%expect {| -Some In_source_tree "." +Some (In_source_tree ".") |}] ;; let%expect_test _ = descendant (r "foo/bar") ~of_:(r "foo"); [%expect {| -Some In_source_tree "bar" +Some (In_source_tree "bar") |}] ;; @@ -177,14 +177,14 @@ None let%expect_test _ = descendant Path.root ~of_:Path.root; [%expect {| -Some In_source_tree "." +Some (In_source_tree ".") |}] ;; let%expect_test _ = descendant (r "foo") ~of_:Path.root; [%expect {| -Some In_source_tree "foo" +Some (In_source_tree "foo") |}] ;; @@ -205,21 +205,21 @@ None let%expect_test _ = descendant (Path.relative build_dir "foo/bar") ~of_:build_dir; [%expect {| -Some In_source_tree "foo/bar" +Some (In_source_tree "foo/bar") |}] ;; let%expect_test _ = descendant (Path.relative build_dir "foo/bar") ~of_:(Path.relative build_dir "foo"); [%expect {| -Some In_source_tree "bar" +Some (In_source_tree "bar") |}] ;; let%expect_test _ = descendant (Path.relative build_dir "foo/bar") ~of_:(Path.relative build_dir "foo"); [%expect {| -Some In_source_tree "bar" +Some (In_source_tree "bar") |}] ;; @@ -453,13 +453,13 @@ let%expect_test _ = [@@expect.uncaught_exn {| ( "(\"Path.rm_rf called on external dir\",\ - \n{ t = External \"/does/not/exist/foo/bar/baz\" })") |}] + \n { t = External \"/does/not/exist/foo/bar/baz\" })") |}] ;; let%expect_test _ = drop_build_context (Path.relative Path.build_dir "foo/bar"); [%expect {| -Some In_source_tree "bar" +Some (In_source_tree "bar") |}] ;; diff --git a/test/blackbox-tests/test-cases/directory-targets/copy-files.t b/test/blackbox-tests/test-cases/directory-targets/copy-files.t index 2f13c365280..ca151fd6a20 100644 --- a/test/blackbox-tests/test-cases/directory-targets/copy-files.t +++ b/test/blackbox-tests/test-cases/directory-targets/copy-files.t @@ -25,7 +25,7 @@ Dune loads all the rules of a directory at once. Error: Dependency cycle between: Computing directory contents of _build/default -> { dir = In_build_dir "default/foo" - ; predicate = Glob Glob "*" + ; predicate = Glob (Glob "*") ; only_generated_files = false } -> Computing directory contents of _build/default diff --git a/test/blackbox-tests/test-cases/enabled_if/eif-dune-describe-crash.t b/test/blackbox-tests/test-cases/enabled_if/eif-dune-describe-crash.t index fc27c378570..273b7a7a82a 100644 --- a/test/blackbox-tests/test-cases/enabled_if/eif-dune-describe-crash.t +++ b/test/blackbox-tests/test-cases/enabled_if/eif-dune-describe-crash.t @@ -28,5 +28,5 @@ Internal error, please report upstream including the contents of _build/log. Description: ("modules_and_obj_dir: failed lookup", - { keys = []; for_ = Exe { first_exe = "test" } }) + { keys = []; for_ = Exe { first_exe = "test" } }) Raised at Stdune__Code_error.raise in file diff --git a/test/blackbox-tests/test-cases/github7806.t b/test/blackbox-tests/test-cases/github7806.t index 06c90074426..2fae64f46cd 100644 --- a/test/blackbox-tests/test-cases/github7806.t +++ b/test/blackbox-tests/test-cases/github7806.t @@ -2,8 +2,8 @@ Internal error, please report upstream including the contents of _build/log. Description: ("[as_in_source_tree_exn] called on something not in source tree", - { t = - External - "$TESTCASE_ROOT" - }) + { t = + External + "$TESTCASE_ROOT" + }) Raised at Stdune__Code_error.raise in file diff --git a/test/blackbox-tests/test-cases/invalid-opam-file-name-github8281.t b/test/blackbox-tests/test-cases/invalid-opam-file-name-github8281.t index 0948b756b61..503cd36f925 100644 --- a/test/blackbox-tests/test-cases/invalid-opam-file-name-github8281.t +++ b/test/blackbox-tests/test-cases/invalid-opam-file-name-github8281.t @@ -27,14 +27,14 @@ Whenever an invalid package name is used, dune crashes when building @doc Internal error, please report upstream including the contents of _build/log. Description: ("[gen_rules] returned rules in a directory that is not a descendant of the directory it was called for", - { dir = In_build_dir "default/_doc/_html/x.y" - ; example = - Rule - { targets = - { root = In_build_dir "default/_doc/_html/x" - ; files = set { "db.js" } - ; dirs = set {} - } - } - }) + { dir = In_build_dir "default/_doc/_html/x.y" + ; example = + Rule + { targets = + { root = In_build_dir "default/_doc/_html/x" + ; files = set { "db.js" } + ; dirs = set {} + } + } + }) Raised at Stdune__Code_error.raise in file diff --git a/test/blackbox-tests/test-cases/menhir/flags-in-workspace.t b/test/blackbox-tests/test-cases/menhir/flags-in-workspace.t index 5dac8a83873..8f16dba1939 100644 --- a/test/blackbox-tests/test-cases/menhir/flags-in-workspace.t +++ b/test/blackbox-tests/test-cases/menhir/flags-in-workspace.t @@ -16,5 +16,5 @@ See #9024. Internal error, please report upstream including the contents of _build/log. Description: ("Syntax identifier is unset", - { name = "menhir" - ; supported_versions = + { name = "menhir" + ; supported_versions = diff --git a/test/blackbox-tests/test-cases/pkg/external-lock-dir.t b/test/blackbox-tests/test-cases/pkg/external-lock-dir.t index b9974fee5fb..61cc4f99cd2 100644 --- a/test/blackbox-tests/test-cases/pkg/external-lock-dir.t +++ b/test/blackbox-tests/test-cases/pkg/external-lock-dir.t @@ -17,8 +17,8 @@ A lock directory which does not exist in the source tree: Internal error, please report upstream including the contents of _build/log. Description: ("Local.relative: received absolute path", - { t = "." - ; path = - "$TESTCASE_ROOT/dune.lock" - }) + { t = "." + ; path = + "$TESTCASE_ROOT/dune.lock" + }) Raised at Stdune__Code_error.raise in file diff --git a/test/blackbox-tests/test-cases/version-corruption.t b/test/blackbox-tests/test-cases/version-corruption.t index 93156474483..1b90c8cd85f 100644 --- a/test/blackbox-tests/test-cases/version-corruption.t +++ b/test/blackbox-tests/test-cases/version-corruption.t @@ -116,10 +116,10 @@ which corresponds to `~min_len` in Link_time_code_gen. $ dune build --debug-artifact-substitution Found placeholder in _build/default/gen_lifecycle.exe: - - placeholder: Vcs_describe In_source_tree "." + - placeholder: Vcs_describe (In_source_tree ".") - evaluates to: "v0.0.1" Found placeholder in _build/default/gen_lifecycle.bc: - - placeholder: Vcs_describe In_source_tree "." + - placeholder: Vcs_describe (In_source_tree ".") - evaluates to: "v0.0.1" $ ocaml compare.ml gen_lifecycle.old ./gen_lifecycle.exe diff --git a/test/expect-tests/dune_lang/sexp_tests.ml b/test/expect-tests/dune_lang/sexp_tests.ml index eb75ac478c2..2201760a264 100644 --- a/test/expect-tests/dune_lang/sexp_tests.ml +++ b/test/expect-tests/dune_lang/sexp_tests.ml @@ -308,7 +308,8 @@ let%expect_test _ = \n ; start = { pos_lnum = 1; pos_bol = 0; pos_cnum = 0 }\ \n ; stop = { pos_lnum = 1; pos_bol = 0; pos_cnum = 0 }\ \n },\ - \n\"Invalid text in unquoted template\", { s = \"x%{\" })") |}] + \n \"Invalid text in unquoted template\",\ + \n { s = \"x%{\" })") |}] ;; let%expect_test _ = @@ -320,7 +321,8 @@ let%expect_test _ = \n ; start = { pos_lnum = 1; pos_bol = 0; pos_cnum = 0 }\ \n ; stop = { pos_lnum = 1; pos_bol = 0; pos_cnum = 0 }\ \n },\ - \n\"Invalid text in unquoted template\", { s = \"x%{\" })") |}] + \n \"Invalid text in unquoted template\",\ + \n { s = \"x%{\" })") |}] ;; let%expect_test _ = @@ -358,11 +360,11 @@ world |> print_dyn; [%expect {| -[ Atom A "hello" +[ Atom (A "hello") ; Comment [ " comment" ] -; Atom A "world" +; Atom (A "world") ; Comment [ " multiline"; " comment" ] -; List [ Atom A "x"; Comment [ " comment inside list" ]; Atom A "y" ] +; List [ Atom (A "x"); Comment [ " comment inside list" ]; Atom (A "y") ] ] |}] ;; diff --git a/test/expect-tests/dune_pkg/dune_pkg_unit_tests.ml b/test/expect-tests/dune_pkg/dune_pkg_unit_tests.ml index 40a5b1c1733..24fa1953aa1 100644 --- a/test/expect-tests/dune_pkg/dune_pkg_unit_tests.ml +++ b/test/expect-tests/dune_pkg/dune_pkg_unit_tests.ml @@ -303,7 +303,7 @@ let%expect_test "encode/decode round trip test for lockdir with complex deps" = ; packages = map { "a" : - { build_command = Some Action [ "progn"; [ "echo"; "hello" ] ] + { build_command = Some (Action [ "progn"; [ "echo"; "hello" ] ]) ; install_command = Some [ "system"; "echo 'world'" ] ; depends = [] ; info = diff --git a/test/expect-tests/dune_rpc_impl/dune_rpc_impl_tests.ml b/test/expect-tests/dune_rpc_impl/dune_rpc_impl_tests.ml index 71ab5e1c0f5..30c86d38b1f 100644 --- a/test/expect-tests/dune_rpc_impl/dune_rpc_impl_tests.ml +++ b/test/expect-tests/dune_rpc_impl/dune_rpc_impl_tests.ml @@ -51,28 +51,32 @@ let%expect_test "serialize and deserialize error message" = Error: Oh no! ---- Original ---- Vbox - 0, - Seq - Box - 0, - Concat - Break ("", 1, ""), ("", 0, ""), - [ Seq Tag Error, Verbatim "Error", Char :; Verbatim "Oh no!" ], - Break ("", 0, ""), ("", 0, "") + (0, + Seq + (Box + (0, + Concat + (Break (("", 1, ""), ("", 0, "")), + [ Seq (Tag (Error, Verbatim "Error"), Char :) + ; Verbatim "Oh no!" + ])), + Break (("", 0, ""), ("", 0, "")))) ------- RPC ------ Vbox - 0, - Seq - Box - 0, - Vbox - 0, - Box - 0, - Concat - Break ("", 1, ""), ("", 0, ""), - [ Seq Tag Error, Verbatim "Error", Char :; Verbatim "Oh no!" ], - Break ("", 0, ""), ("", 0, "") |}] + (0, + Seq + (Box + (0, + Vbox + (0, + Box + (0, + Concat + (Break (("", 1, ""), ("", 0, "")), + [ Seq (Tag (Error, Verbatim "Error"), Char :) + ; Verbatim "Oh no!" + ])))), + Break (("", 0, ""), ("", 0, "")))) |}] ;; let%expect_test "serialize and deserialize error message with location" = @@ -91,44 +95,45 @@ let%expect_test "serialize and deserialize error message with location" = Error: An error with location! ---- Original ---- Vbox - 0, - Concat - Nop, - [ Seq - Box 0, Tag Loc, Text "File \"Bar\", line 1, characters 2-3:", - Break ("", 0, ""), ("", 0, "") - ; Seq - Box - 0, - Concat - Break ("", 1, ""), ("", 0, ""), - [ Seq Tag Error, Verbatim "Error", Char : - ; Verbatim "An error with location!" - ], - Break ("", 0, ""), ("", 0, "") - ] + (0, + Concat + (Nop, + [ Seq + (Box (0, Tag (Loc, Text "File \"Bar\", line 1, characters 2-3:")), + Break (("", 0, ""), ("", 0, ""))) + ; Seq + (Box + (0, + Concat + (Break (("", 1, ""), ("", 0, "")), + [ Seq (Tag (Error, Verbatim "Error"), Char :) + ; Verbatim "An error with location!" + ])), + Break (("", 0, ""), ("", 0, ""))) + ])) ------- RPC ------ Vbox - 0, - Concat - Nop, - [ Seq - Box 0, Tag Loc, Text "File \"/Foo/Bar\", line 1, characters 2-3:", - Break ("", 0, ""), ("", 0, "") - ; Seq - Box - 0, - Vbox - 0, - Box - 0, - Concat - Break ("", 1, ""), ("", 0, ""), - [ Seq Tag Error, Verbatim "Error", Char : - ; Verbatim "An error with location!" - ], - Break ("", 0, ""), ("", 0, "") - ] |}] + (0, + Concat + (Nop, + [ Seq + (Box + (0, Tag (Loc, Text "File \"/Foo/Bar\", line 1, characters 2-3:")), + Break (("", 0, ""), ("", 0, ""))) + ; Seq + (Box + (0, + Vbox + (0, + Box + (0, + Concat + (Break (("", 1, ""), ("", 0, "")), + [ Seq (Tag (Error, Verbatim "Error"), Char :) + ; Verbatim "An error with location!" + ])))), + Break (("", 0, ""), ("", 0, ""))) + ])) |}] ;; let%expect_test "serialize and deserialize error with location excerpt and hint" = @@ -158,78 +163,83 @@ let%expect_test "serialize and deserialize error with location excerpt and hint" Hint: Hint 2 ---- Original ---- Vbox - 0, - Concat - Nop, - [ Seq - Box 0, Tag Loc, Text "File \"foo.ml\", line 1, characters 2-3:", - Break ("", 0, ""), ("", 0, "") - ; Seq - Box - 0, - Concat - Break ("", 1, ""), ("", 0, ""), - [ Seq Tag Error, Verbatim "Error", Char : - ; Verbatim "An error with location!" - ], - Break ("", 0, ""), ("", 0, "") - ; Seq - Box - 0, - Seq - Seq Tag Hint, Verbatim "Hint:", Break ("", 1, ""), ("", 0, ""), - Verbatim "Hint 1", - Break ("", 0, ""), ("", 0, "") - ; Seq - Box - 0, - Seq - Seq Tag Hint, Verbatim "Hint:", Break ("", 1, ""), ("", 0, ""), - Verbatim "Hint 2", - Break ("", 0, ""), ("", 0, "") - ] + (0, + Concat + (Nop, + [ Seq + (Box + (0, Tag (Loc, Text "File \"foo.ml\", line 1, characters 2-3:")), + Break (("", 0, ""), ("", 0, ""))) + ; Seq + (Box + (0, + Concat + (Break (("", 1, ""), ("", 0, "")), + [ Seq (Tag (Error, Verbatim "Error"), Char :) + ; Verbatim "An error with location!" + ])), + Break (("", 0, ""), ("", 0, ""))) + ; Seq + (Box + (0, + Seq + (Seq + (Tag (Hint, Verbatim "Hint:"), + Break (("", 1, ""), ("", 0, ""))), + Verbatim "Hint 1")), + Break (("", 0, ""), ("", 0, ""))) + ; Seq + (Box + (0, + Seq + (Seq + (Tag (Hint, Verbatim "Hint:"), + Break (("", 1, ""), ("", 0, ""))), + Verbatim "Hint 2")), + Break (("", 0, ""), ("", 0, ""))) + ])) ------- RPC ------ Vbox - 0, - Concat - Nop, - [ Seq - Box - 0, - Tag - Loc, - Text - "File \"TEST/foo.ml\", line 1, characters 2-3:", - Break ("", 0, ""), ("", 0, "") - ; Seq - Box - 0, - Vbox - 0, - Concat - Break ("", 0, ""), ("", 0, ""), - [ Box - 0, - Concat - Break ("", 1, ""), ("", 0, ""), - [ Seq Tag Error, Verbatim "Error", Char : - ; Verbatim "An error with location!" - ] - ; Box - 0, - Seq - Seq - Tag Hint, Verbatim "Hint:", - Break ("", 1, ""), ("", 0, ""), - Verbatim "Hint 1" - ; Box - 0, - Seq - Seq - Tag Hint, Verbatim "Hint:", - Break ("", 1, ""), ("", 0, ""), - Verbatim "Hint 2" - ], - Break ("", 0, ""), ("", 0, "") - ] |}] + (0, + Concat + (Nop, + [ Seq + (Box + (0, + Tag + (Loc, + Text + "File \"TEST/foo.ml\", line 1, characters 2-3:")), + Break (("", 0, ""), ("", 0, ""))) + ; Seq + (Box + (0, + Vbox + (0, + Concat + (Break (("", 0, ""), ("", 0, "")), + [ Box + (0, + Concat + (Break (("", 1, ""), ("", 0, "")), + [ Seq (Tag (Error, Verbatim "Error"), Char :) + ; Verbatim "An error with location!" + ])) + ; Box + (0, + Seq + (Seq + (Tag (Hint, Verbatim "Hint:"), + Break (("", 1, ""), ("", 0, ""))), + Verbatim "Hint 1")) + ; Box + (0, + Seq + (Seq + (Tag (Hint, Verbatim "Hint:"), + Break (("", 1, ""), ("", 0, ""))), + Verbatim "Hint 2")) + ]))), + Break (("", 0, ""), ("", 0, ""))) + ])) |}] ;; diff --git a/test/expect-tests/memo/main.ml b/test/expect-tests/memo/main.ml index 8bc927a7461..6c4776a7242 100644 --- a/test/expect-tests/memo/main.ml +++ b/test/expect-tests/memo/main.ml @@ -308,7 +308,7 @@ let%expect_test _ = [%expect {| (Some [ (Some "lazy_memo", "foo"); (Some "id", "lazy: foo") ], - Some [ (Some "lazy_memo", "foo"); (Some "id", "lazy: foo") ]) + Some [ (Some "lazy_memo", "foo"); (Some "id", "lazy: foo") ]) |}] ;; @@ -331,7 +331,7 @@ let%expect_test _ = [%expect {| (Some [ (Some "lazy_memo", "foo"); (None, ()) ], - Some [ (Some "lazy_memo", "foo"); (None, ()) ]) + Some [ (Some "lazy_memo", "foo"); (None, ()) ]) |}] ;; diff --git a/test/expect-tests/module_tests.ml b/test/expect-tests/module_tests.ml index e412a90772e..8da1d6a9b89 100644 --- a/test/expect-tests/module_tests.ml +++ b/test/expect-tests/module_tests.ml @@ -23,9 +23,9 @@ let%expect_test "Module.Kind encoding round trip" = test Impl; [%expect {| { ast = "impl"; decoded = Ok Impl } |}]; test (Alias []); - [%expect {| { ast = "alias"; decoded = Ok Alias [] } |}]; + [%expect {| { ast = "alias"; decoded = Ok (Alias []) } |}]; test (Alias [ module_name "A" ]); - [%expect {| { ast = "(alias (A))"; decoded = Ok Alias [ "A" ] } |}]; + [%expect {| { ast = "(alias (A))"; decoded = Ok (Alias [ "A" ]) } |}]; test (Alias [ module_name "A"; module_name "B" ]); - [%expect {| { ast = "(alias (A B))"; decoded = Ok Alias [ "A"; "B" ] } |}] + [%expect {| { ast = "(alias (A B))"; decoded = Ok (Alias [ "A"; "B" ]) } |}] ;;