From 8dcbc94b6522eba508bcad45c2012ee904df437f Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 13 Apr 2022 12:55:31 -0700 Subject: [PATCH] Add `fmt` and `pp` to `Map`, `Set`, `Ordmap`, and `Ordset` Add formatters and pretty printers to the map and set collections, using associative list and list syntactic representations, respectively. Sort the unordered map/set contents to avoid unnecessary output instability. --- bootstrap/src/basis/formattableIntf.ml | 6 ++-- bootstrap/src/basis/map.ml | 17 +++++++++- bootstrap/src/basis/map.mli | 5 +-- bootstrap/src/basis/mapIntf.ml | 13 ++++++++ bootstrap/src/basis/ordmap.ml | 15 ++++++++- bootstrap/src/basis/ordmap.mli | 5 +-- bootstrap/src/basis/ordset.ml | 6 ++++ bootstrap/src/basis/set.ml | 8 +++++ bootstrap/src/basis/setIntf.ml | 11 +++++++ bootstrap/test/basis/map/dune | 1 + .../test_empty_cmper_m_singleton_length.ml | 4 +-- bootstrap/test/basis/map/test_fmt.expected | 5 +++ bootstrap/test/basis/map/test_fmt.ml | 32 +++++++++++++++++++ .../map/test_iter2_equal_subset_disjoint.ml | 8 ++--- .../test/basis/map/test_of_alist_remove.ml | 4 +-- .../basis/map/test_of_alist_remove_hlt.ml | 4 +-- bootstrap/test/basis/ordmap/dune | 1 + .../test_empty_cmper_m_singleton_length.ml | 4 +-- bootstrap/test/basis/ordmap/test_fmt.expected | 5 +++ bootstrap/test/basis/ordmap/test_fmt.ml | 30 +++++++++++++++++ .../test_iter2_equal_subset_disjoint.ml | 8 ++--- .../test/basis/ordmap/test_of_alist_remove.ml | 4 +-- .../basis/ordmap/test_of_alist_remove_hlt.ml | 4 +-- bootstrap/test/basis/ordmap/test_of_array.ml | 2 +- .../test/basis/ordmap/test_search_nth.ml | 2 +- bootstrap/test/basis/ordset/ordsetTest.ml | 12 ------- .../test/basis/ordset/test_choose_hlt.ml | 1 - ...st_empty_cmper_m_singleton_length.expected | 4 +-- .../test_empty_cmper_m_singleton_length.ml | 1 - .../test/basis/ordset/test_filter.expected | 14 ++++---- bootstrap/test/basis/ordset/test_filter.ml | 1 - .../test/basis/ordset/test_filteri.expected | 14 ++++---- bootstrap/test/basis/ordset/test_filteri.ml | 1 - bootstrap/test/basis/ordset/test_fold2.ml | 1 - bootstrap/test/basis/ordset/test_hash_fold.ml | 1 - .../test_iter2_equal_subset_disjoint.ml | 1 - .../ordset/test_mem_insert_subset.expected | 2 +- .../basis/ordset/test_mem_insert_subset.ml | 1 - .../test/basis/ordset/test_of_array.expected | 4 +-- bootstrap/test/basis/ordset/test_of_array.ml | 1 - .../ordset/test_of_list_duplicate.expected | 2 +- .../basis/ordset/test_of_list_duplicate.ml | 1 - .../basis/ordset/test_of_list_remove.expected | 8 ++--- .../test/basis/ordset/test_of_list_remove.ml | 1 - .../ordset/test_of_list_to_list_to_array.ml | 1 - .../test/basis/ordset/test_partition_tf.ml | 1 - .../test/basis/ordset/test_partitioni_tf.ml | 1 - bootstrap/test/basis/ordset/test_reduce.ml | 1 - .../basis/ordset/test_search_nth.expected | 8 ++--- .../test/basis/ordset/test_search_nth.ml | 1 - bootstrap/test/basis/ordset/test_stress.ml | 1 - bootstrap/test/basis/ordset/test_stress2.ml | 1 - bootstrap/test/basis/set/setTest.ml | 12 ------- bootstrap/test/basis/set/test_choose_hlt.ml | 1 - ...st_empty_cmper_m_singleton_length.expected | 4 +-- .../test_empty_cmper_m_singleton_length.ml | 1 - bootstrap/test/basis/set/test_fold2.ml | 1 - bootstrap/test/basis/set/test_hash_fold.ml | 1 - .../set/test_iter2_equal_subset_disjoint.ml | 1 - .../basis/set/test_mem_insert_subset.expected | 2 +- .../test/basis/set/test_mem_insert_subset.ml | 1 - .../basis/set/test_of_list_duplicate.expected | 2 +- .../test/basis/set/test_of_list_duplicate.ml | 1 - .../basis/set/test_of_list_remove.expected | 14 ++++---- .../test/basis/set/test_of_list_remove.ml | 1 - .../set/test_of_list_to_list_to_array.ml | 1 - bootstrap/test/basis/set/test_reduce.ml | 1 - bootstrap/test/basis/set/test_stress.ml | 1 - 68 files changed, 212 insertions(+), 123 deletions(-) create mode 100644 bootstrap/test/basis/map/test_fmt.expected create mode 100644 bootstrap/test/basis/map/test_fmt.ml create mode 100644 bootstrap/test/basis/ordmap/test_fmt.expected create mode 100644 bootstrap/test/basis/ordmap/test_fmt.ml delete mode 100644 bootstrap/test/basis/ordset/ordsetTest.ml delete mode 100644 bootstrap/test/basis/set/setTest.ml diff --git a/bootstrap/src/basis/formattableIntf.ml b/bootstrap/src/basis/formattableIntf.ml index f286b2327..b1690b7f5 100644 --- a/bootstrap/src/basis/formattableIntf.ml +++ b/bootstrap/src/basis/formattableIntf.ml @@ -1,6 +1,6 @@ (** Formattable type functor signature. *) -(** Monomorphic Fmt pretty printing conversion functions. *) +(** Monomorphic Fmt pretty printing function. *) module type SMono = sig type t @@ -8,7 +8,7 @@ module type SMono = sig (** [pp t formatter] applies a formatted representation of [t] to the [formatter]. *) end -(** Polymorphic Fmt pretty printing conversion functions. *) +(** Polymorphic Fmt pretty printing function. *) module type SPoly = sig type 'a t @@ -18,7 +18,7 @@ module type SPoly = sig [pp_a] for the parametric type value [a]. *) end -(** Polymorphic Fmt pretty printing conversion functions. *) +(** Polymorphic Fmt pretty printing function. *) module type SPoly2 = sig type ('a, 'b) t diff --git a/bootstrap/src/basis/map.ml b/bootstrap/src/basis/map.ml index 44c26ae94..fdf922869 100644 --- a/bootstrap/src/basis/map.ml +++ b/bootstrap/src/basis/map.ml @@ -939,10 +939,25 @@ end let to_array t = SetToArray.(to_array (init t)) +let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) fmt_v t formatter = + let kvcmp (k0, _) (k1, _) = t.cmper.cmp k0 k1 in + let t_sorted = Array.sort ~cmp:kvcmp (to_array t) |> Array.to_list in + List.fmt ~alt ~width (fun (k, v) formatter -> + formatter + |> Fmt.fmt "(" + |> t.cmper.pp k + |> Fmt.fmt ", " + |> fmt_v v + |> Fmt.fmt ")" + ) t_sorted formatter + +let pp fmt_v t formatter = + fmt fmt_v t formatter + (**************************************************************************************************) (* Begin test support. *) -let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) fmt_v t formatter = +let fmt_internals ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) fmt_v t formatter = let fmt_sep ~alt ~width ?(edge=false) formatter = begin formatter |> Fmt.fmt (match alt, edge with true, _ -> "\n" | false, false -> "; " | false, true -> "") diff --git a/bootstrap/src/basis/map.mli b/bootstrap/src/basis/map.mli index 662267a1a..7e0ae7ded 100644 --- a/bootstrap/src/basis/map.mli +++ b/bootstrap/src/basis/map.mli @@ -9,6 +9,7 @@ val bits_per_level: Uns.t val bits_per_hash: Uns.t val hash_fold: ('v -> Hash.State.t -> Hash.State.t) -> ('k, 'v, 'cmp) t -> Hash.State.t -> Hash.State.t -val fmt: ?alt:bool -> ?width:int64 -> ('v -> (module Fmt.Formatter) -> (module Fmt.Formatter)) - -> ('k, 'v, 'cmp) t -> (module Fmt.Formatter) -> (module Fmt.Formatter) +val fmt_internals: ?alt:bool -> ?width:int64 + -> ('v -> (module Fmt.Formatter) -> (module Fmt.Formatter)) -> ('k, 'v, 'cmp) t + -> (module Fmt.Formatter) -> (module Fmt.Formatter) val validate: ('k, 'v, 'cmp) t -> unit diff --git a/bootstrap/src/basis/mapIntf.ml b/bootstrap/src/basis/mapIntf.ml index ff5a021c2..8d45dcf75 100644 --- a/bootstrap/src/basis/mapIntf.ml +++ b/bootstrap/src/basis/mapIntf.ml @@ -42,6 +42,19 @@ module type S = sig val cmper: ('k, 'v, 'cmp) t -> ('k, 'cmp) Cmper.t (** [cmper t] returns the comparator associated with the map [t]. *) + (** {1 Formatting} *) + + val fmt: ?alt:bool -> ?width:int64 -> ('v -> (module Fmt.Formatter) -> (module Fmt.Formatter)) + -> ('k, 'v, 'cmp) t -> (module Fmt.Formatter) -> (module Fmt.Formatter) + (** [fmt ~alt ~width fmt_v t] uses the [fmt_v] formatter to format a syntactically valid + associative list representation of [t]. If [~alt=true], the output is broken across multiple + lines with outermost indentation [~width] (elements are indented to [~width + 4]). *) + + val pp: ('v -> (module Fmt.Formatter) -> (module Fmt.Formatter)) + -> ('k, 'v, 'cmp) t -> (module Fmt.Formatter) -> (module Fmt.Formatter) + (** [pp pp_v t formatter] applies a formatted representation of [t] to the [formatter] using + [pp_v] for the parametric type value [v]. *) + (** {1 Creation} *) val empty: ('k, 'cmp) cmper -> ('k, 'v, 'cmp) t diff --git a/bootstrap/src/basis/ordmap.ml b/bootstrap/src/basis/ordmap.ml index 27d6d5e8b..3f8ea4bb3 100644 --- a/bootstrap/src/basis/ordmap.ml +++ b/bootstrap/src/basis/ordmap.ml @@ -1220,10 +1220,23 @@ let reduce_hlt ~f t = | None -> halt "Empty map" | Some v -> v +let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) fmt_v t formatter = + List.fmt ~alt ~width (fun (k, v) formatter -> + formatter + |> Fmt.fmt "(" + |> t.cmper.pp k + |> Fmt.fmt ", " + |> fmt_v v + |> Fmt.fmt ")" + ) (to_alist t) formatter + +let pp fmt_v t formatter = + fmt fmt_v t formatter + (**************************************************************************************************) (* Begin test support. *) -let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) fmt_v t formatter = +let fmt_internals ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) fmt_v t formatter = let fmt_sep ~alt ~width ?(edge=false) formatter = begin formatter |> Fmt.fmt (match alt, edge with true, _ -> "\n" | false, false -> "; " | false, true -> "") diff --git a/bootstrap/src/basis/ordmap.mli b/bootstrap/src/basis/ordmap.mli index 708e910d8..2a517a62e 100644 --- a/bootstrap/src/basis/ordmap.mli +++ b/bootstrap/src/basis/ordmap.mli @@ -5,6 +5,7 @@ type ('k, 'v, 'cmp) t include MapIntf.SOrd with type ('k, 'v, 'cmp) t := ('k, 'v, 'cmp) t (* Exposed for testing purposes only. *) -val fmt: ?alt:bool -> ?width:int64 -> ('v -> (module Fmt.Formatter) -> (module Fmt.Formatter)) - -> ('k, 'v, 'cmp) t -> (module Fmt.Formatter) -> (module Fmt.Formatter) +val fmt_internals: ?alt:bool -> ?width:int64 + -> ('v -> (module Fmt.Formatter) -> (module Fmt.Formatter)) -> ('k, 'v, 'cmp) t + -> (module Fmt.Formatter) -> (module Fmt.Formatter) val validate: ('k, 'v, 'cmp) t -> unit diff --git a/bootstrap/src/basis/ordset.ml b/bootstrap/src/basis/ordset.ml index 708cdcd15..415156d2a 100644 --- a/bootstrap/src/basis/ordset.ml +++ b/bootstrap/src/basis/ordset.ml @@ -147,3 +147,9 @@ let reduce ~f t = let reduce_hlt ~f t = Ordmap.kreduce_hlt ~f t + +let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) t formatter = + List.fmt ~alt ~width (cmper t).pp (to_list t) formatter + +let pp t formatter = + fmt t formatter diff --git a/bootstrap/src/basis/set.ml b/bootstrap/src/basis/set.ml index a46586cce..de793aad8 100644 --- a/bootstrap/src/basis/set.ml +++ b/bootstrap/src/basis/set.ml @@ -137,3 +137,11 @@ end let to_array t = SetToArray.(to_array (init t)) + +let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) t formatter = + let cmper = cmper t in + let t_sorted = Array.sort ~cmp:cmper.cmp (to_array t) |> Array.to_list in + List.fmt ~alt ~width cmper.pp t_sorted formatter + +let pp t formatter = + fmt t formatter diff --git a/bootstrap/src/basis/setIntf.ml b/bootstrap/src/basis/setIntf.ml index ac287b57a..6aefbd241 100644 --- a/bootstrap/src/basis/setIntf.ml +++ b/bootstrap/src/basis/setIntf.ml @@ -40,6 +40,17 @@ module type S = sig val cmper: ('a, 'cmp) t -> ('a, 'cmp) Cmper.t (** [cmper t] returns the comparator associated with [t]. *) + (** {1 Formatting} *) + + val fmt: ?alt:bool -> ?width:uns -> ('a, 'cmp) t -> (module Fmt.Formatter) + -> (module Fmt.Formatter) + (** [fmt ~alt ~width t] formats a syntactically valid list representation of [t]. If [~alt=true], + the output is broken across multiple lines with outermost indentation [~width] (elements are + indented to [~width + 4]). *) + + val pp: ('a, 'cmp) t -> (module Fmt.Formatter) -> (module Fmt.Formatter) + (** [pp t formatter] applies a formatted representation of [t] to the [formatter]. *) + (** {1 Creation} *) val empty: ('a, 'cmp) cmper -> ('a, 'cmp) t diff --git a/bootstrap/test/basis/map/dune b/bootstrap/test/basis/map/dune index 453b52e6c..d2974f314 100644 --- a/bootstrap/test/basis/map/dune +++ b/bootstrap/test/basis/map/dune @@ -5,6 +5,7 @@ test_empty_cmper_m_singleton_length test_filter test_filter_map + test_fmt test_fold2 test_fold_until test_fold2_until diff --git a/bootstrap/test/basis/map/test_empty_cmper_m_singleton_length.ml b/bootstrap/test/basis/map/test_empty_cmper_m_singleton_length.ml index 110e96765..1d63271dc 100644 --- a/bootstrap/test/basis/map/test_empty_cmper_m_singleton_length.ml +++ b/bootstrap/test/basis/map/test_empty_cmper_m_singleton_length.ml @@ -8,7 +8,7 @@ let test () = validate e; assert (length e = 0L); File.Fmt.stdout - |> (fmt ~alt:true Unit.pp) e + |> (fmt_internals ~alt:true Unit.pp) e |> Fmt.fmt "\n" |> ignore; @@ -16,7 +16,7 @@ let test () = validate s; assert (length s = 1L); File.Fmt.stdout - |> (fmt ~alt:true String.pp) s + |> (fmt_internals ~alt:true String.pp) s |> Fmt.fmt "\n" |> ignore diff --git a/bootstrap/test/basis/map/test_fmt.expected b/bootstrap/test/basis/map/test_fmt.expected new file mode 100644 index 000000000..a3566c4b5 --- /dev/null +++ b/bootstrap/test/basis/map/test_fmt.expected @@ -0,0 +1,5 @@ +fmt (of_klist []) -> [] +fmt (of_klist [0]) -> [(0, 0)] +fmt (of_klist [0; 1]) -> [(0, 0); (1, 100)] +fmt (of_klist [0; 2]) -> [(0, 0); (2, 200)] +fmt (of_klist [2; 3]) -> [(2, 200); (3, 300)] diff --git a/bootstrap/test/basis/map/test_fmt.ml b/bootstrap/test/basis/map/test_fmt.ml new file mode 100644 index 000000000..7bfc44651 --- /dev/null +++ b/bootstrap/test/basis/map/test_fmt.ml @@ -0,0 +1,32 @@ +open! Basis.Rudiments +open! Basis +open MapTest +open Map + +let test () = + let rec fn = function + | [] -> () + | l :: lists' -> begin + let map = of_klist l in + File.Fmt.stdout + |> Fmt.fmt "fmt (of_klist " + |> (List.pp Uns.pp) l + |> Fmt.fmt ") -> " + |> fmt Uns.pp map + |> Fmt.fmt "\n" + |> ignore; + fn lists' + end + in + (* NB: [0; 1] and [0; 2] collide. This is because we're using UnsTestCmper to get stable test + * output; the hashing results from all but the last binding hashed are discarded. *) + let lists = [ + []; + [0L]; + [0L; 1L]; + [0L; 2L]; + [2L; 3L] + ] in + fn lists + +let _ = test () diff --git a/bootstrap/test/basis/map/test_iter2_equal_subset_disjoint.ml b/bootstrap/test/basis/map/test_iter2_equal_subset_disjoint.ml index db53a7996..41db09c23 100644 --- a/bootstrap/test/basis/map/test_iter2_equal_subset_disjoint.ml +++ b/bootstrap/test/basis/map/test_iter2_equal_subset_disjoint.ml @@ -18,9 +18,9 @@ let test () = | Some _, None -> begin File.Fmt.stdout |> Fmt.fmt "Should be equal: " - |> (fmt Uns.pp) map0 + |> (fmt_internals Uns.pp) map0 |> Fmt.fmt " " - |> (fmt Uns.pp) map1 + |> (fmt_internals Uns.pp) map1 |> Fmt.fmt "\n" |> ignore; assert false; @@ -40,9 +40,9 @@ let test () = | Some _, Some _ -> begin File.Fmt.stdout |> Fmt.fmt "Should be disjoint: " - |> (fmt Uns.pp) map0 + |> (fmt_internals Uns.pp) map0 |> Fmt.fmt " " - |> (fmt Uns.pp) map1 + |> (fmt_internals Uns.pp) map1 |> Fmt.fmt "\n" |> ignore; assert false; diff --git a/bootstrap/test/basis/map/test_of_alist_remove.ml b/bootstrap/test/basis/map/test_of_alist_remove.ml index f3dc578d8..ff5c75da9 100644 --- a/bootstrap/test/basis/map/test_of_alist_remove.ml +++ b/bootstrap/test/basis/map/test_of_alist_remove.ml @@ -17,9 +17,9 @@ let test () = |> Fmt.fmt "remove " |> Uns.pp k |> Fmt.fmt "\n" - |> (fmt ~alt:true String.pp) map + |> (fmt_internals ~alt:true String.pp) map |> Fmt.fmt " ->\n" - |> (fmt ~alt:true String.pp) map' + |> (fmt_internals ~alt:true String.pp) map' |> Fmt.fmt "\n" |> ignore end in diff --git a/bootstrap/test/basis/map/test_of_alist_remove_hlt.ml b/bootstrap/test/basis/map/test_of_alist_remove_hlt.ml index a20b35feb..bc692e7a5 100644 --- a/bootstrap/test/basis/map/test_of_alist_remove_hlt.ml +++ b/bootstrap/test/basis/map/test_of_alist_remove_hlt.ml @@ -17,9 +17,9 @@ let test () = |> Fmt.fmt "remove_hlt " |> Uns.pp k |> Fmt.fmt "\n" - |> (fmt ~alt:true String.pp) map + |> (fmt_internals ~alt:true String.pp) map |> Fmt.fmt " ->\n" - |> (fmt ~alt:true String.pp) map' + |> (fmt_internals ~alt:true String.pp) map' |> Fmt.fmt "\n" |> ignore end in diff --git a/bootstrap/test/basis/ordmap/dune b/bootstrap/test/basis/ordmap/dune index 5225a287b..db378b75d 100644 --- a/bootstrap/test/basis/ordmap/dune +++ b/bootstrap/test/basis/ordmap/dune @@ -7,6 +7,7 @@ test_filter_map test_filteri test_filteri_map + test_fmt test_fold_right_until test_fold_until test_fold2 diff --git a/bootstrap/test/basis/ordmap/test_empty_cmper_m_singleton_length.ml b/bootstrap/test/basis/ordmap/test_empty_cmper_m_singleton_length.ml index 8ea743582..15d374695 100644 --- a/bootstrap/test/basis/ordmap/test_empty_cmper_m_singleton_length.ml +++ b/bootstrap/test/basis/ordmap/test_empty_cmper_m_singleton_length.ml @@ -7,11 +7,11 @@ let test () = let e = empty (module Uns) in validate e; assert (length e = 0L); - File.Fmt.stdout |> (fmt Unit.pp) e |> Fmt.fmt "\n" |> ignore; + File.Fmt.stdout |> (fmt_internals Unit.pp) e |> Fmt.fmt "\n" |> ignore; let s = singleton (cmper_m e) ~k:0L ~v:"zero" in validate s; assert (length s = 1L); - File.Fmt.stdout |> (fmt String.pp) s |> Fmt.fmt "\n" |> ignore + File.Fmt.stdout |> (fmt_internals String.pp) s |> Fmt.fmt "\n" |> ignore let _ = test () diff --git a/bootstrap/test/basis/ordmap/test_fmt.expected b/bootstrap/test/basis/ordmap/test_fmt.expected new file mode 100644 index 000000000..a3566c4b5 --- /dev/null +++ b/bootstrap/test/basis/ordmap/test_fmt.expected @@ -0,0 +1,5 @@ +fmt (of_klist []) -> [] +fmt (of_klist [0]) -> [(0, 0)] +fmt (of_klist [0; 1]) -> [(0, 0); (1, 100)] +fmt (of_klist [0; 2]) -> [(0, 0); (2, 200)] +fmt (of_klist [2; 3]) -> [(2, 200); (3, 300)] diff --git a/bootstrap/test/basis/ordmap/test_fmt.ml b/bootstrap/test/basis/ordmap/test_fmt.ml new file mode 100644 index 000000000..46f129607 --- /dev/null +++ b/bootstrap/test/basis/ordmap/test_fmt.ml @@ -0,0 +1,30 @@ +open! Basis.Rudiments +open! Basis +open OrdmapTest +open Ordmap + +let test () = + let rec fn = function + | [] -> () + | l :: lists' -> begin + let ordmap = of_klist l in + File.Fmt.stdout + |> Fmt.fmt "fmt (of_klist " + |> (List.pp Uns.pp) l + |> Fmt.fmt ") -> " + |> fmt Uns.pp ordmap + |> Fmt.fmt "\n" + |> ignore; + fn lists' + end + in + let lists = [ + []; + [0L]; + [0L; 1L]; + [0L; 2L]; + [2L; 3L] + ] in + fn lists + +let _ = test () diff --git a/bootstrap/test/basis/ordmap/test_iter2_equal_subset_disjoint.ml b/bootstrap/test/basis/ordmap/test_iter2_equal_subset_disjoint.ml index 71df5800f..838f4ae30 100644 --- a/bootstrap/test/basis/ordmap/test_iter2_equal_subset_disjoint.ml +++ b/bootstrap/test/basis/ordmap/test_iter2_equal_subset_disjoint.ml @@ -18,9 +18,9 @@ let test () = | Some _, None -> begin File.Fmt.stdout |> Fmt.fmt "Should be equal: " - |> (fmt Uns.pp) ordmap0 + |> (fmt_internals Uns.pp) ordmap0 |> Fmt.fmt ", " - |> (fmt Uns.pp) ordmap1 + |> (fmt_internals Uns.pp) ordmap1 |> Fmt.fmt "\n" |> ignore; assert false; @@ -40,9 +40,9 @@ let test () = | Some _, Some _ -> begin File.Fmt.stdout |> Fmt.fmt "Should be disjoint: " - |> (fmt Uns.pp) ordmap0 + |> (fmt_internals Uns.pp) ordmap0 |> Fmt.fmt ", " - |> (fmt Uns.pp) ordmap1 + |> (fmt_internals Uns.pp) ordmap1 |> Fmt.fmt "\n" |> ignore; assert false; diff --git a/bootstrap/test/basis/ordmap/test_of_alist_remove.ml b/bootstrap/test/basis/ordmap/test_of_alist_remove.ml index ccd5bd178..bdb6c16e8 100644 --- a/bootstrap/test/basis/ordmap/test_of_alist_remove.ml +++ b/bootstrap/test/basis/ordmap/test_of_alist_remove.ml @@ -17,9 +17,9 @@ let test () = |> Fmt.fmt "remove " |> Uns.pp k |> Fmt.fmt "\n " - |> (fmt ~alt:true ~width:4L String.pp) ordmap + |> (fmt_internals ~alt:true ~width:4L String.pp) ordmap |> Fmt.fmt " ->\n " - |> (fmt ~alt:true ~width:4L String.pp) ordmap' + |> (fmt_internals ~alt:true ~width:4L String.pp) ordmap' |> Fmt.fmt "\n" |> ignore end in diff --git a/bootstrap/test/basis/ordmap/test_of_alist_remove_hlt.ml b/bootstrap/test/basis/ordmap/test_of_alist_remove_hlt.ml index 1415c7579..e40abd0d5 100644 --- a/bootstrap/test/basis/ordmap/test_of_alist_remove_hlt.ml +++ b/bootstrap/test/basis/ordmap/test_of_alist_remove_hlt.ml @@ -17,9 +17,9 @@ let test () = |> Fmt.fmt "remove_hlt " |> Uns.pp k |> Fmt.fmt "\n " - |> (fmt ~alt:true ~width:4L String.pp) ordmap + |> (fmt_internals ~alt:true ~width:4L String.pp) ordmap |> Fmt.fmt " ->\n " - |> (fmt ~alt:true ~width:4L String.pp) ordmap' + |> (fmt_internals ~alt:true ~width:4L String.pp) ordmap' |> Fmt.fmt "\n" |> ignore end in diff --git a/bootstrap/test/basis/ordmap/test_of_array.ml b/bootstrap/test/basis/ordmap/test_of_array.ml index df8c5918e..18d3a27da 100644 --- a/bootstrap/test/basis/ordmap/test_of_array.ml +++ b/bootstrap/test/basis/ordmap/test_of_array.ml @@ -10,7 +10,7 @@ let test () = |> Fmt.fmt "of_array " |> (Array.pp (pp_kv_pair String.pp)) kvs |> Fmt.fmt " -> " - |> (fmt ~alt:true String.pp) ordmap + |> (fmt_internals ~alt:true String.pp) ordmap |> Fmt.fmt "\n" |> ignore; validate ordmap diff --git a/bootstrap/test/basis/ordmap/test_search_nth.ml b/bootstrap/test/basis/ordmap/test_search_nth.ml index a3ef2e704..f34b1a464 100644 --- a/bootstrap/test/basis/ordmap/test_search_nth.ml +++ b/bootstrap/test/basis/ordmap/test_search_nth.ml @@ -6,7 +6,7 @@ open Ordmap let test () = let test_search ordmap (key_max:uns) = begin File.Fmt.stdout - |> (fmt Uns.pp) ordmap + |> (fmt_internals Uns.pp) ordmap |> Fmt.fmt "\n" |> ignore; Range.Uns.iter (0L =:= key_max) ~f:(fun probe -> diff --git a/bootstrap/test/basis/ordset/ordsetTest.ml b/bootstrap/test/basis/ordset/ordsetTest.ml deleted file mode 100644 index 6ecea54e9..000000000 --- a/bootstrap/test/basis/ordset/ordsetTest.ml +++ /dev/null @@ -1,12 +0,0 @@ -open! Basis.Rudiments -open! Basis -open Ordset - -let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) t formatter = - let cmper = cmper t in - let t_sorted = Array.sort ~cmp:cmper.cmp (to_array t) in - let indent = 4L in - let width' = width + indent in - formatter - |> Fmt.fmt "Ordset " - |> (Array.fmt ~alt ~width:width' cmper.pp) t_sorted diff --git a/bootstrap/test/basis/ordset/test_choose_hlt.ml b/bootstrap/test/basis/ordset/test_choose_hlt.ml index 8df1f61f7..8ab0e7847 100644 --- a/bootstrap/test/basis/ordset/test_choose_hlt.ml +++ b/bootstrap/test/basis/ordset/test_choose_hlt.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.expected b/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.expected index 9d1aac57a..c67be4936 100644 --- a/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.expected +++ b/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.expected @@ -1,2 +1,2 @@ -Ordset [||] -Ordset [|0|] +[] +[0] diff --git a/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.ml b/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.ml index 0e893f9df..9c09163ee 100644 --- a/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.ml +++ b/bootstrap/test/basis/ordset/test_empty_cmper_m_singleton_length.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_filter.expected b/bootstrap/test/basis/ordset/test_filter.expected index eb7aa1e69..bdd9dd12d 100644 --- a/bootstrap/test/basis/ordset/test_filter.expected +++ b/bootstrap/test/basis/ordset/test_filter.expected @@ -1,7 +1,7 @@ -Ordset [||] -> Ordset [||] -Ordset [|0|] -> Ordset [|0|] -Ordset [|0; 1|] -> Ordset [|0|] -Ordset [|0; 1; 2|] -> Ordset [|0; 2|] -Ordset [|0; 1; 2; 3|] -> Ordset [|0; 2|] -Ordset [|0; 1; 2; 3; 4|] -> Ordset [|0; 2; 4|] -Ordset [|0; 1; 2; 3; 4; 5|] -> Ordset [|0; 2; 4|] +[] -> [] +[0] -> [0] +[0; 1] -> [0] +[0; 1; 2] -> [0; 2] +[0; 1; 2; 3] -> [0; 2] +[0; 1; 2; 3; 4] -> [0; 2; 4] +[0; 1; 2; 3; 4; 5] -> [0; 2; 4] diff --git a/bootstrap/test/basis/ordset/test_filter.ml b/bootstrap/test/basis/ordset/test_filter.ml index 9afd32a23..f40180cd2 100644 --- a/bootstrap/test/basis/ordset/test_filter.ml +++ b/bootstrap/test/basis/ordset/test_filter.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_filteri.expected b/bootstrap/test/basis/ordset/test_filteri.expected index c3634271e..970b03f40 100644 --- a/bootstrap/test/basis/ordset/test_filteri.expected +++ b/bootstrap/test/basis/ordset/test_filteri.expected @@ -1,7 +1,7 @@ -Ordset [||] -> Ordset [||] -Ordset [|0|] -> Ordset [|0|] -Ordset [|0; 10|] -> Ordset [|0|] -Ordset [|0; 10; 20|] -> Ordset [|0; 20|] -Ordset [|0; 10; 20; 30|] -> Ordset [|0; 20|] -Ordset [|0; 10; 20; 30; 40|] -> Ordset [|0; 20; 40|] -Ordset [|0; 10; 20; 30; 40; 50|] -> Ordset [|0; 20; 40|] +[] -> [] +[0] -> [0] +[0; 10] -> [0] +[0; 10; 20] -> [0; 20] +[0; 10; 20; 30] -> [0; 20] +[0; 10; 20; 30; 40] -> [0; 20; 40] +[0; 10; 20; 30; 40; 50] -> [0; 20; 40] diff --git a/bootstrap/test/basis/ordset/test_filteri.ml b/bootstrap/test/basis/ordset/test_filteri.ml index 1c71c66fa..85406cc18 100644 --- a/bootstrap/test/basis/ordset/test_filteri.ml +++ b/bootstrap/test/basis/ordset/test_filteri.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_fold2.ml b/bootstrap/test/basis/ordset/test_fold2.ml index 48bf22cfb..96e6fa643 100644 --- a/bootstrap/test/basis/ordset/test_fold2.ml +++ b/bootstrap/test/basis/ordset/test_fold2.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_hash_fold.ml b/bootstrap/test/basis/ordset/test_hash_fold.ml index f37175be7..37e5ae909 100644 --- a/bootstrap/test/basis/ordset/test_hash_fold.ml +++ b/bootstrap/test/basis/ordset/test_hash_fold.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_iter2_equal_subset_disjoint.ml b/bootstrap/test/basis/ordset/test_iter2_equal_subset_disjoint.ml index 018cce569..81d994a94 100644 --- a/bootstrap/test/basis/ordset/test_iter2_equal_subset_disjoint.ml +++ b/bootstrap/test/basis/ordset/test_iter2_equal_subset_disjoint.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_mem_insert_subset.expected b/bootstrap/test/basis/ordset/test_mem_insert_subset.expected index f2e0dda99..35b967229 100644 --- a/bootstrap/test/basis/ordset/test_mem_insert_subset.expected +++ b/bootstrap/test/basis/ordset/test_mem_insert_subset.expected @@ -1 +1 @@ -Ordset [|1; 2; 3; 44; 45; 56; 60; 66; 75; 81; 91|] +[1; 2; 3; 44; 45; 56; 60; 66; 75; 81; 91] diff --git a/bootstrap/test/basis/ordset/test_mem_insert_subset.ml b/bootstrap/test/basis/ordset/test_mem_insert_subset.ml index bf8cefb9b..c5bfe6ed8 100644 --- a/bootstrap/test/basis/ordset/test_mem_insert_subset.ml +++ b/bootstrap/test/basis/ordset/test_mem_insert_subset.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_of_array.expected b/bootstrap/test/basis/ordset/test_of_array.expected index 4fc26e1e9..a13954be0 100644 --- a/bootstrap/test/basis/ordset/test_of_array.expected +++ b/bootstrap/test/basis/ordset/test_of_array.expected @@ -1,2 +1,2 @@ -of_array [||] -> Ordset [||] -of_array [|0; 1; 4; 5; 3; 2|] -> Ordset [|0; 1; 2; 3; 4; 5|] +of_array [||] -> [] +of_array [|0; 1; 4; 5; 3; 2|] -> [0; 1; 2; 3; 4; 5] diff --git a/bootstrap/test/basis/ordset/test_of_array.ml b/bootstrap/test/basis/ordset/test_of_array.ml index cbad91533..f251996aa 100644 --- a/bootstrap/test/basis/ordset/test_of_array.ml +++ b/bootstrap/test/basis/ordset/test_of_array.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_of_list_duplicate.expected b/bootstrap/test/basis/ordset/test_of_list_duplicate.expected index b45931478..111bb8686 100644 --- a/bootstrap/test/basis/ordset/test_of_list_duplicate.expected +++ b/bootstrap/test/basis/ordset/test_of_list_duplicate.expected @@ -1 +1 @@ -Ordset [|0|] +[0] diff --git a/bootstrap/test/basis/ordset/test_of_list_duplicate.ml b/bootstrap/test/basis/ordset/test_of_list_duplicate.ml index 37dfb300a..1261a25ca 100644 --- a/bootstrap/test/basis/ordset/test_of_list_duplicate.ml +++ b/bootstrap/test/basis/ordset/test_of_list_duplicate.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_of_list_remove.expected b/bootstrap/test/basis/ordset/test_of_list_remove.expected index 4c9e7f87b..835cdba0f 100644 --- a/bootstrap/test/basis/ordset/test_of_list_remove.expected +++ b/bootstrap/test/basis/ordset/test_of_list_remove.expected @@ -1,12 +1,12 @@ --- Not member. --- remove 2 -Ordset [|0; 1|] -> Ordset [|0; 1|] +[0; 1] -> [0; 1] --- Member, length 1 -> 0. --- remove 0 -Ordset [|0|] -> Ordset [||] +[0] -> [] --- Member, length 2 -> 1. --- remove 1 -Ordset [|0; 1|] -> Ordset [|0|] +[0; 1] -> [0] --- Member, length 3 -> 2. --- remove 2 -Ordset [|0; 1; 2|] -> Ordset [|0; 1|] +[0; 1; 2] -> [0; 1] diff --git a/bootstrap/test/basis/ordset/test_of_list_remove.ml b/bootstrap/test/basis/ordset/test_of_list_remove.ml index 4809893a6..9386a4715 100644 --- a/bootstrap/test/basis/ordset/test_of_list_remove.ml +++ b/bootstrap/test/basis/ordset/test_of_list_remove.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_of_list_to_list_to_array.ml b/bootstrap/test/basis/ordset/test_of_list_to_list_to_array.ml index d54228a42..bee6c02ef 100644 --- a/bootstrap/test/basis/ordset/test_of_list_to_list_to_array.ml +++ b/bootstrap/test/basis/ordset/test_of_list_to_list_to_array.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_partition_tf.ml b/bootstrap/test/basis/ordset/test_partition_tf.ml index 4fe2204f3..7f4366916 100644 --- a/bootstrap/test/basis/ordset/test_partition_tf.ml +++ b/bootstrap/test/basis/ordset/test_partition_tf.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_partitioni_tf.ml b/bootstrap/test/basis/ordset/test_partitioni_tf.ml index 036a165e6..b751b08ea 100644 --- a/bootstrap/test/basis/ordset/test_partitioni_tf.ml +++ b/bootstrap/test/basis/ordset/test_partitioni_tf.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_reduce.ml b/bootstrap/test/basis/ordset/test_reduce.ml index 1e5f2cb13..88f9d70da 100644 --- a/bootstrap/test/basis/ordset/test_reduce.ml +++ b/bootstrap/test/basis/ordset/test_reduce.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_search_nth.expected b/bootstrap/test/basis/ordset/test_search_nth.expected index 5c65d7d48..49b1fa245 100644 --- a/bootstrap/test/basis/ordset/test_search_nth.expected +++ b/bootstrap/test/basis/ordset/test_search_nth.expected @@ -1,16 +1,16 @@ -Ordset [||] +[] 0 -> <, <>, > -Ordset [|1|] +[1] 0 -> <[0]=1, <>, <[0]=1 1 -> =[0]=1, =1, =[0]=1 2 -> >[0]=1, <>, >[0]=1 -Ordset [|1; 3|] +[1; 3] 0 -> <[0]=1, <>, <[0]=1 1 -> =[0]=1, =1, =[0]=1 2 -> >[0]=1, <>, <[1]=3 3 -> =[1]=3, =3, =[1]=3 4 -> >[1]=3, <>, >[1]=3 -Ordset [|1; 3; 5|] +[1; 3; 5] 0 -> <[0]=1, <>, <[0]=1 1 -> =[0]=1, =1, =[0]=1 2 -> >[0]=1, <>, <[1]=3 diff --git a/bootstrap/test/basis/ordset/test_search_nth.ml b/bootstrap/test/basis/ordset/test_search_nth.ml index 41c88a289..da6a274a7 100644 --- a/bootstrap/test/basis/ordset/test_search_nth.ml +++ b/bootstrap/test/basis/ordset/test_search_nth.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_stress.ml b/bootstrap/test/basis/ordset/test_stress.ml index 9b970e448..fb54f3a57 100644 --- a/bootstrap/test/basis/ordset/test_stress.ml +++ b/bootstrap/test/basis/ordset/test_stress.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/ordset/test_stress2.ml b/bootstrap/test/basis/ordset/test_stress2.ml index 3a7b53ab0..08ec2285d 100644 --- a/bootstrap/test/basis/ordset/test_stress2.ml +++ b/bootstrap/test/basis/ordset/test_stress2.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! OrdsetTest open Ordset let test () = diff --git a/bootstrap/test/basis/set/setTest.ml b/bootstrap/test/basis/set/setTest.ml deleted file mode 100644 index 28614e50e..000000000 --- a/bootstrap/test/basis/set/setTest.ml +++ /dev/null @@ -1,12 +0,0 @@ -open! Basis.Rudiments -open! Basis -open Set - -let fmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) t formatter = - let cmper = cmper t in - let t_sorted = Array.sort ~cmp:cmper.cmp (to_array t) in - let indent = 4L in - let width' = width + indent in - formatter - |> Fmt.fmt "Set " - |> (Array.fmt ~alt ~width:width' cmper.pp) t_sorted diff --git a/bootstrap/test/basis/set/test_choose_hlt.ml b/bootstrap/test/basis/set/test_choose_hlt.ml index 8941a23fb..f5317d80b 100644 --- a/bootstrap/test/basis/set/test_choose_hlt.ml +++ b/bootstrap/test/basis/set/test_choose_hlt.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.expected b/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.expected index fc4084369..c67be4936 100644 --- a/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.expected +++ b/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.expected @@ -1,2 +1,2 @@ -Set [||] -Set [|0|] +[] +[0] diff --git a/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.ml b/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.ml index 6632c23e4..316caf081 100644 --- a/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.ml +++ b/bootstrap/test/basis/set/test_empty_cmper_m_singleton_length.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_fold2.ml b/bootstrap/test/basis/set/test_fold2.ml index 07a2a1190..7d34a4082 100644 --- a/bootstrap/test/basis/set/test_fold2.ml +++ b/bootstrap/test/basis/set/test_fold2.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_hash_fold.ml b/bootstrap/test/basis/set/test_hash_fold.ml index dfba13d1e..fe5a64acc 100644 --- a/bootstrap/test/basis/set/test_hash_fold.ml +++ b/bootstrap/test/basis/set/test_hash_fold.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_iter2_equal_subset_disjoint.ml b/bootstrap/test/basis/set/test_iter2_equal_subset_disjoint.ml index 784fda3dc..1a1bf78c5 100644 --- a/bootstrap/test/basis/set/test_iter2_equal_subset_disjoint.ml +++ b/bootstrap/test/basis/set/test_iter2_equal_subset_disjoint.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_mem_insert_subset.expected b/bootstrap/test/basis/set/test_mem_insert_subset.expected index 7709962a8..35b967229 100644 --- a/bootstrap/test/basis/set/test_mem_insert_subset.expected +++ b/bootstrap/test/basis/set/test_mem_insert_subset.expected @@ -1 +1 @@ -Set [|1; 2; 3; 44; 45; 56; 60; 66; 75; 81; 91|] +[1; 2; 3; 44; 45; 56; 60; 66; 75; 81; 91] diff --git a/bootstrap/test/basis/set/test_mem_insert_subset.ml b/bootstrap/test/basis/set/test_mem_insert_subset.ml index c09f3a61d..a1316bbc2 100644 --- a/bootstrap/test/basis/set/test_mem_insert_subset.ml +++ b/bootstrap/test/basis/set/test_mem_insert_subset.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_of_list_duplicate.expected b/bootstrap/test/basis/set/test_of_list_duplicate.expected index 86396e1a7..111bb8686 100644 --- a/bootstrap/test/basis/set/test_of_list_duplicate.expected +++ b/bootstrap/test/basis/set/test_of_list_duplicate.expected @@ -1 +1 @@ -Set [|0|] +[0] diff --git a/bootstrap/test/basis/set/test_of_list_duplicate.ml b/bootstrap/test/basis/set/test_of_list_duplicate.ml index 15a729071..22cbe2926 100644 --- a/bootstrap/test/basis/set/test_of_list_duplicate.ml +++ b/bootstrap/test/basis/set/test_of_list_duplicate.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_of_list_remove.expected b/bootstrap/test/basis/set/test_of_list_remove.expected index 0f2994c4f..c9ed03f6c 100644 --- a/bootstrap/test/basis/set/test_of_list_remove.expected +++ b/bootstrap/test/basis/set/test_of_list_remove.expected @@ -1,21 +1,21 @@ --- Not member, elm empty. --- remove 2 -Set [|0; 1|] -> Set [|0; 1|] +[0; 1] -> [0; 1] --- Not member, elm of different value. --- remove 91 -Set [|1|] -> Set [|1|] +[1] -> [1] --- Member, length 1 -> 0. --- remove 0 -Set [|0|] -> Set [||] +[0] -> [] --- Member, length 2 -> 1. --- remove 1 -Set [|0; 1|] -> Set [|0|] +[0; 1] -> [0] --- Member, length 3 -> 2. --- remove 2 -Set [|0; 1; 2|] -> Set [|0; 1|] +[0; 1; 2] -> [0; 1] --- Member, subnode elms 2 -> 1. --- remove 66 -Set [|0; 1; 66|] -> Set [|0; 1|] +[0; 1; 66] -> [0; 1] --- Member, subnode elms 3 -> 2. --- remove 91 -Set [|0; 1; 66; 91|] -> Set [|0; 1; 66|] +[0; 1; 66; 91] -> [0; 1; 66] diff --git a/bootstrap/test/basis/set/test_of_list_remove.ml b/bootstrap/test/basis/set/test_of_list_remove.ml index 9d06b2916..7214c6d9e 100644 --- a/bootstrap/test/basis/set/test_of_list_remove.ml +++ b/bootstrap/test/basis/set/test_of_list_remove.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_of_list_to_list_to_array.ml b/bootstrap/test/basis/set/test_of_list_to_list_to_array.ml index d8084d08e..ba7845857 100644 --- a/bootstrap/test/basis/set/test_of_list_to_list_to_array.ml +++ b/bootstrap/test/basis/set/test_of_list_to_list_to_array.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_reduce.ml b/bootstrap/test/basis/set/test_reduce.ml index 60e4a5f2c..0559673e0 100644 --- a/bootstrap/test/basis/set/test_reduce.ml +++ b/bootstrap/test/basis/set/test_reduce.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! SetTest open Set let test () = diff --git a/bootstrap/test/basis/set/test_stress.ml b/bootstrap/test/basis/set/test_stress.ml index b0ec28297..60779789a 100644 --- a/bootstrap/test/basis/set/test_stress.ml +++ b/bootstrap/test/basis/set/test_stress.ml @@ -1,6 +1,5 @@ open! Basis.Rudiments open! Basis -open! SetTest open Set let test () =