New Upstream Release - extlib
Ready changes
Summary
Merged new upstream version: 1.7.9 (was: 1.7.8).
Resulting package
Built on 2022-12-14T05:10 (took 8m28s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases libextlib-ocaml-dbgsymapt install -t fresh-releases libextlib-ocaml-devapt install -t fresh-releases libextlib-ocaml
Lintian Result
Diff
diff --git a/.gitignore b/.gitignore
index 320600f..83453f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,5 @@
/test/extlib_test
/test/extlib_test.exe
/test/util/zlib-test/zlib-test
+/_build/
+/_opam/
diff --git a/CHANGES b/CHANGES
index fe64687..a3c8248 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+1.7.9 (2022-08-05)
+* build with OCaml 5 (Kate)
+* minimum supported version is OCaml 4.02 now
+* build with dune (Makefile is now deprecated) (Marek Kubica, Kate)
+* sync String deprecation attributes with upstream
+
1.7.8 (2021-01-19)
* sync with OCaml 4.12
* breaking change: ExtList.find_map type updated to match stdlib (following deprecation in previous release)
diff --git a/Makefile b/Makefile
index f5e94d2..e122783 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
VERSION:=$(shell git --git-dir=.git describe --always --long)
-RELEASE:=1.7.8
+RELEASE:=1.7.9
ifndef VERSION
VERSION:=$(RELEASE)
@@ -48,21 +48,12 @@ sw_deps_$(1):
sw_test_$(1):
-opam exec --switch=$(1) -- make clean build test >/dev/null 2>/dev/null
# expected to fail < 4.03.0
-ifneq "$(1)" "3.12.1"
-ifneq "$(1)" "4.00.1"
-ifneq "$(1)" "4.01.0"
ifneq "$(1)" "4.02.3"
- -opam exec --switch=$(1) -- ocaml test/std.ml
-endif
-endif
-endif
+ -opam exec --switch=$(1) -- ocaml check_stdlib.ml
endif
endef
$(foreach version,\
- 3.12.1\
- 4.00.1\
- 4.01.0\
4.02.3\
4.03.0\
4.04.2\
@@ -73,5 +64,8 @@ $(foreach version,\
4.09.1\
4.10.2\
4.11.1\
- 4.12.0~beta1\
+ 4.12.0\
+ 4.13.1\
+ 4.14.0\
+ 5.0.0~alpha1\
,$(eval $(call gen_sw,$(version))))
diff --git a/test/std.ml b/check_stdlib.ml
similarity index 100%
rename from test/std.ml
rename to check_stdlib.ml
diff --git a/debian/changelog b/debian/changelog
index 80975e2..25cb8ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+extlib (1.7.9-1) UNRELEASED; urgency=low
+
+ * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk> Wed, 14 Dec 2022 05:02:59 -0000
+
extlib (1.7.8-2) unstable; urgency=medium
[ Stéphane Glondu ]
diff --git a/dune-project b/dune-project
new file mode 100644
index 0000000..a4628e7
--- /dev/null
+++ b/dune-project
@@ -0,0 +1,2 @@
+(lang dune 1.0)
+(name extlib)
diff --git a/opam b/extlib.opam
similarity index 58%
rename from opam
rename to extlib.opam
index 95df275..248ced3 100644
--- a/opam
+++ b/extlib.opam
@@ -1,11 +1,10 @@
opam-version: "2.0"
maintainer: "ygrek@autistici.org"
homepage: "https://github.com/ygrek/ocaml-extlib"
-dev-repo: "git://github.com/ygrek/ocaml-extlib.git"
+dev-repo: "git+https://github.com/ygrek/ocaml-extlib.git"
bug-reports: "https://github.com/ygrek/ocaml-extlib/issues"
doc: ["https://ygrek.org/p/extlib/doc/"]
license: "LGPL-2.1-only with OCaml-LGPL-linking-exception"
-synopsis: "A complete yet small extension for OCaml standard library"
authors: [
"Nicolas Cannasse"
"Brian Hurt"
@@ -20,20 +19,24 @@ authors: [
"Gabriel Scherer"
"Pietro Abate"
]
-build: [
- [make "minimal=1" "build"]
- [make "minimal=1" "test"] {with-test}
- [make "minimal=1" "doc"] {with-doc}
-]
-install: [ [make "minimal=1" "install"] ]
depends: [
- "ocaml"
- "ocamlfind" {build}
+ "dune" {>= "1.0"}
+ "ocaml" {>= "4.02"}
"cppo" {build}
- "base-bytes" {build}
]
+synopsis:
+ "A complete yet small extension for OCaml standard library"
description: """
The purpose of this library is to add new functions to OCaml standard library
modules, to modify some functions in order to get better performances or
safety (tail-recursive) and also to provide new modules which should be useful
-for day to day programming."""
+for day to day programming.
+
+Current goal is to maintain compatibility, new software is encouraged to not use extlib since stdlib
+is now seeing many additions and improvements which make many parts of extlib obsolete.
+For tail-recursion safety consider using other libraries e.g. containers.
+"""
+build: [
+ ["dune" "build" "-p" name "-j" jobs]
+ ["dune" "runtest" "-p" name "-j" jobs] {with-test}
+]
diff --git a/src/IO.ml b/src/IO.ml
index 9954d88..6856bed 100644
--- a/src/IO.ml
+++ b/src/IO.ml
@@ -18,6 +18,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
+#if OCAML < 407
+module Stdlib = Pervasives
+#endif
+
open ExtBytes
type input = {
@@ -310,19 +314,19 @@ let input_channel ch =
End_of_file -> raise No_more_input
);
in_input = (fun s p l ->
- let n = Pervasives.input ch s p l in
+ let n = Stdlib.input ch s p l in
if n = 0 then raise No_more_input;
n
);
- in_close = (fun () -> Pervasives.close_in ch);
+ in_close = (fun () -> Stdlib.close_in ch);
}
let output_channel ch =
{
out_write = (fun c -> output_char ch c);
- out_output = (fun s p l -> Pervasives.output ch s p l; l);
- out_close = (fun () -> Pervasives.close_out ch);
- out_flush = (fun () -> Pervasives.flush ch);
+ out_output = (fun s p l -> Stdlib.output ch s p l; l);
+ out_close = (fun () -> Stdlib.close_out ch);
+ out_flush = (fun () -> Stdlib.flush ch);
}
let input_enum e =
@@ -539,7 +543,7 @@ let read_double ch =
Int64.float_of_bits (read_i64 ch)
let write_byte o n =
- (* doesn't test bounds of n in order to keep semantics of Pervasives.output_byte *)
+ (* doesn't test bounds of n in order to keep semantics of Stdlib.output_byte *)
write o (Char.unsafe_chr (n land 0xFF))
let write_string o s =
diff --git a/src/configure.ml b/src/configure.ml
index f13d63e..2f84044 100644
--- a/src/configure.ml
+++ b/src/configure.ml
@@ -1,18 +1,22 @@
open Printf
-let show_bytes s =
- let (_:int) = Sys.command (sprintf "ocamlfind query -format %s bytes" (Filename.quote s)) in ()
+let cppo_args define var =
+ let version = Scanf.sscanf Sys.ocaml_version "%d.%d." (fun major minor -> major * 100 + minor) in
+ var "OCAML" (string_of_int version);
+ if Sys.word_size = 32 then define "WORD_SIZE_32";
+ define "WITH_BYTES"
let () =
match Sys.argv with
| [|_;"-cppo-args"|] ->
- let version = Scanf.sscanf Sys.ocaml_version "%d.%d." (fun major minor -> major * 100 + minor) in
- printf "-D \\\"OCAML %d\\\"\n" version;
- print_endline (if Sys.word_size = 32 then "-D WORD_SIZE_32 " else "");
- show_bytes "-D WITH_BYTES";
+ cppo_args (printf "-D %s ") (printf "-D '%s %s' ");
+ exit 0
+ | [|_;"-cppo-args-lines"|] ->
+ let pr fmt = ksprintf print_endline fmt in
+ cppo_args (fun x -> pr "-D"; pr "%s" x) (fun k v -> pr "-D"; pr "%s %s" k v);
exit 0
| [|_;"-compile-args"|] ->
if Sys.ocaml_version >= "4.00.0" then print_endline "-bin-annot";
- show_bytes "-package bytes";
+ print_endline "-package bytes";
exit 0
| _ -> failwith "not gonna happen"
diff --git a/src/dune b/src/dune
new file mode 100644
index 0000000..bf962fa
--- /dev/null
+++ b/src/dune
@@ -0,0 +1,18 @@
+(library
+ (name extlib)
+ (public_name extlib)
+ (modules :standard \ configure install base64 unzip uChar uTF8)
+ (flags :standard -w -3-6-9-27-32-33-35-39-50)
+ (preprocess
+ (action
+ (run %{bin:cppo} %{read-lines:compat-level} %{input-file})))
+ (wrapped false))
+
+(rule
+ (targets compat-level)
+ (deps
+ (:< configure.ml))
+ (action
+ (with-stdout-to
+ %{targets}
+ (run ocaml %{<} -cppo-args-lines))))
diff --git a/src/extArray.ml b/src/extArray.ml
index dbcdcd4..27efdc5 100644
--- a/src/extArray.ml
+++ b/src/extArray.ml
@@ -216,4 +216,10 @@ let create_float = make_float
#endif
#endif
+#if OCAML >= 500
+external create : int -> 'a -> 'a array = "caml_make_vect"
+let create_matrix = make_matrix
+let make_float = create_float
+#endif
+
end
diff --git a/src/extList.ml b/src/extList.ml
index 2936c5e..16cfd11 100644
--- a/src/extList.ml
+++ b/src/extList.ml
@@ -20,6 +20,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
+#if OCAML < 407
+module Stdlib = Pervasives
+#endif
+
module List = struct
#if OCAML < 408
@@ -407,7 +411,7 @@ let combine l1 l2 =
loop dummy l1 l2;
dummy.tl
-let sort ?(cmp=Pervasives.compare) = List.sort cmp
+let sort ?(cmp=Stdlib.compare) = List.sort cmp
#if OCAML < 406
let rec init size f =
diff --git a/src/extString.ml b/src/extString.ml
index cd441ea..b3f1fbc 100644
--- a/src/extString.ml
+++ b/src/extString.ml
@@ -328,4 +328,17 @@ let rindex_from_opt s i c =
#endif
+#if OCAML >= 500
+let create = Bytes.create
+let set = Bytes.set
+let unsafe_set = Bytes.unsafe_set
+let copy x = Bytes.unsafe_to_string (Bytes.copy (Bytes.unsafe_of_string x))
+let fill = Bytes.fill
+let unsafe_fill = Bytes.unsafe_fill
+let uppercase = uppercase_ascii
+let lowercase = lowercase_ascii
+let capitalize = capitalize_ascii
+let uncapitalize = uncapitalize_ascii
+#endif
+
end
diff --git a/src/extString.mli b/src/extString.mli
index a92a583..9de4291 100644
--- a/src/extString.mli
+++ b/src/extString.mli
@@ -51,29 +51,29 @@ module String :
val nsplit : string -> string -> string list
(** [nsplit s sep] splits the string [s] into a list of strings
- which are separated by [sep].
- [nsplit "" _] returns the empty list.
- @raise Invalid_string if [sep] is empty string. *)
+ which are separated by [sep].
+ [nsplit "" _] returns the empty list.
+ @raise Invalid_string if [sep] is empty string. *)
val join : string -> string list -> string
(** Same as [concat] *)
val slice : ?first:int -> ?last:int -> string -> string
(** [slice ?first ?last s] returns a "slice" of the string
- which corresponds to the characters [s.[first]],
- [s.[first+1]], ..., [s[last-1]]. Note that the character at
- index [last] is {b not} included! If [first] is omitted it
- defaults to the start of the string, i.e. index 0, and if
- [last] is omitted is defaults to point just past the end of
- [s], i.e. [length s]. Thus, [slice s] is equivalent to
- [copy s].
-
- Negative indexes are interpreted as counting from the end of
- the string. For example, [slice ~last:-2 s] will return the
- string [s], but without the last two characters.
-
- This function {b never} raises any exceptions. If the
- indexes are out of bounds they are automatically clipped.
+ which corresponds to the characters [s.[first]],
+ [s.[first+1]], ..., [s[last-1]]. Note that the character at
+ index [last] is {b not} included! If [first] is omitted it
+ defaults to the start of the string, i.e. index 0, and if
+ [last] is omitted is defaults to point just past the end of
+ [s], i.e. [length s]. Thus, [slice s] is equivalent to
+ [copy s].
+
+ Negative indexes are interpreted as counting from the end of
+ the string. For example, [slice ~last:-2 s] will return the
+ string [s], but without the last two characters.
+
+ This function {b never} raises any exceptions. If the
+ indexes are out of bounds they are automatically clipped.
*)
val lchop : string -> string
@@ -115,50 +115,54 @@ module String :
val map : (char -> char) -> string -> string
(** [map f s] returns a string where all characters [c] in [s] have been
- replaced by [f c]. **)
+ replaced by [f c]. **)
val mapi : (int -> char -> char) -> string -> string
- (** [map f s] returns a string where all characters [c] in [s] have been replaced by [f i s.\[i\]]. **)
+ (** [map f s] returns a string where all characters [c] in [s] have been replaced
+ by [f i s.\[i\]]. **)
val iteri : (int -> char -> unit) -> string -> unit
(** Call [f i s.\[i\]] for every position [i] in string *)
val fold_left : ('a -> char -> 'a) -> 'a -> string -> 'a
- (** [fold_left f a s] is
- [f (... (f (f a s.[0]) s.[1]) ...) s.[n-1]] *)
+ (** [fold_left f a s] is
+ [f (... (f (f a s.[0]) s.[1]) ...) s.[n-1]] *)
+
val fold_right : (char -> 'a -> 'a) -> string -> 'a -> 'a
- (** [fold_right f s b] is
- [f s.[0] (f s.[1] (... (f s.[n-1] b) ...))] *)
+ (** [fold_right f s b] is
+ [f s.[0] (f s.[1] (... (f s.[n-1] b) ...))] *)
val explode : string -> char list
- (** [explode s] returns the list of characters in the string [s]. *)
+ (** [explode s] returns the list of characters in the string [s]. *)
+
val implode : char list -> string
- (** [implode cs] returns a string resulting from concatenating
- the characters in the list [cs]. *)
+ (** [implode cs] returns a string resulting from concatenating
+ the characters in the list [cs]. *)
val strip : ?chars:string -> string -> string
(** Returns the string without the chars if they are at the beginning or
- at the end of the string. By default chars are " \t\r\n". *)
+ at the end of the string. By default chars are " \t\r\n". *)
val exists : string -> string -> bool
(** [exists str sub] returns true if [sub] is a substring of [str] or
- false otherwise. *)
+ false otherwise. *)
val replace_chars : (char -> string) -> string -> string
(** [replace_chars f s] returns a string where all chars [c] of [s] have been
- replaced by the string returned by [f c]. *)
+ replaced by the string returned by [f c]. *)
- val replace : str:string -> sub:string -> by:string -> bool * string
- (** [replace ~str ~sub ~by] returns a tuple constisting of a boolean
- and a string where the first occurrence of the string [sub]
- within [str] has been replaced by the string [by]. The boolean
- is true if a subtitution has taken place. *)
+ val replace : str:string -> sub:string -> by:string -> bool * string
+ (** [replace ~str ~sub ~by] returns a tuple constisting of a boolean
+ and a string where the first occurrence of the string [sub]
+ within [str] has been replaced by the string [by]. The boolean
+ is true if a subtitution has taken place. *)
- (** Return a copy of the argument, without leading and trailing
- whitespace. The characters regarded as whitespace are: [' '],
- ['\012'], ['\n'], ['\r'], and ['\t'].
- (Note that it is different from {!strip} defaults). *)
val trim : string -> string
+ (** Return a copy of the argument, without leading and trailing
+ whitespace. The characters regarded as whitespace are:
+ [' '], ['\012'], ['\n'], ['\r'], and ['\t'].
+ (Note that it is different from {!strip} defaults). *)
+
(** {6 Compatibility Functions} *)
@@ -169,19 +173,32 @@ module String :
val split_on_char : char -> string -> string list
+
(** {6 Older Functions} *)
- (** Please refer to the Ocaml Manual for documentation of these
- functions. *)
+ (** Please refer to the OCaml Manual for documentation of these
+ functions. *)
val length : string -> int
val get : string -> int -> char
val set : Bytes.t -> int -> char -> unit
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use Bytes.set instead."]
+#endif
val create : int -> Bytes.t
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use Bytes.create instead."]
+#endif
val make : int -> char -> string
val copy : string -> string
+#if OCAML >= 402
+ [@@ocaml.deprecated]
+#endif
val sub : string -> int -> int -> string
val fill : Bytes.t -> int -> int -> char -> unit
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use Bytes.fill instead."]
+#endif
val blit : string -> int -> Bytes.t -> int -> int -> unit
val concat : string -> string list -> string
val iter : (char -> unit) -> string -> unit
@@ -197,10 +214,26 @@ module String :
val contains : string -> char -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
+
val uppercase : string -> string
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use String.uppercase_ascii instead."]
+#endif
+
val lowercase : string -> string
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use String.lowercase_ascii instead."]
+#endif
+
val capitalize : string -> string
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use String.capitalize_ascii instead."]
+#endif
+
val uncapitalize : string -> string
+#if OCAML >= 402
+ [@@ocaml.deprecated "Use String.uncapitalize_ascii instead."]
+#endif
type t = string
val compare : t -> t -> int
@@ -217,7 +250,13 @@ module String :
external unsafe_get : string -> int -> char = "%string_unsafe_get"
val unsafe_set : Bytes.t -> int -> char -> unit
+#if OCAML >= 402
+ [@@ocaml.deprecated]
+#endif
val unsafe_blit : string -> int -> Bytes.t -> int -> int -> unit
val unsafe_fill : Bytes.t -> int -> int -> char -> unit
+#if OCAML >= 402
+ [@@ocaml.deprecated]
+#endif
end
diff --git a/src/optParse.ml b/src/optParse.ml
index a3d8ef3..acff88f 100644
--- a/src/optParse.ml
+++ b/src/optParse.ml
@@ -510,7 +510,7 @@ module Formatter =
| 1 -> '-'
| _ -> failwith "titled_formatter: Too much indentation"
in
- sprintf "%*s%s\n%*s%s\n\n" !indent "" (String.capitalize h) !indent ""
+ sprintf "%*s%s\n%*s%s\n\n" !indent "" (String.capitalize_ascii h) !indent ""
(String.make (String.length h) c)
in
let format_usage usage =
diff --git a/src/refList.ml b/src/refList.ml
index 7f1ae6e..849caab 100644
--- a/src/refList.ml
+++ b/src/refList.ml
@@ -116,12 +116,12 @@ module Index = struct
let index pred rl =
let index = ref (-1) in
- List.find (fun it -> incr index; pred it; ) !rl;
+ let _ = List.find (fun it -> incr index; pred it; ) !rl in
!index
let index_of rl item =
let index = ref (-1) in
- List.find (fun it -> incr index; it = item; ) !rl;
+ let _ = List.find (fun it -> incr index; it = item; ) !rl in
!index
let at_index rl pos =
diff --git a/src/uTF8.ml b/src/uTF8.ml
index 06c58f9..943610c 100644
--- a/src/uTF8.ml
+++ b/src/uTF8.ml
@@ -18,6 +18,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)
+#if OCAML < 407
+module Stdlib = Pervasives
+#endif
+
open UChar
type t = string
@@ -182,7 +186,7 @@ let rec iter_aux proc s i =
let iter proc s = iter_aux proc s 0
-let compare s1 s2 = Pervasives.compare s1 s2
+let compare s1 s2 = Stdlib.compare s1 s2
exception Malformed_code
diff --git a/test/dune b/test/dune
new file mode 100644
index 0000000..cc5acde
--- /dev/null
+++ b/test/dune
@@ -0,0 +1,9 @@
+(executable
+ (name runner)
+ (flags :standard -w -3-6-35-27)
+ (modules :standard \ test_Unzip test_UTF8 test_Base64)
+ (libraries extlib))
+
+(alias
+ (name runtest)
+ (action (run ./runner.exe)))
diff --git a/test/runner.ml b/test/runner.ml
index ec29560..444ee3e 100644
--- a/test/runner.ml
+++ b/test/runner.ml
@@ -4,6 +4,19 @@ let () =
let filter =
match Array.to_list Sys.argv with
| [] | [_] -> None
- | _::l -> Some (List.map String.lowercase l)
+ | _::l -> Some (List.map ExtString.String.lowercase l)
in
+ let tests = [
+ Test_BitSet.register;
+ Test_Dllist.register;
+ Test_DynArray.register;
+ Test_ExtArray.register;
+ Test_ExtHashtbl.register;
+ Test_ExtList.register;
+ Test_ExtString.register;
+ Test_IO.register;
+ ]
+ in
+ List.iter (fun register -> register ()) tests;
+
exit (if Util.run_all filter then 0 else 1)
diff --git a/test/test_BitSet.ml b/test/test_BitSet.ml
index 2567b84..47635a7 100644
--- a/test/test_BitSet.ml
+++ b/test/test_BitSet.ml
@@ -200,7 +200,7 @@ let test_exceptions () =
assert (expect_exn
(fun () ->
let s = B.create 8 in
- B.is_set s (-19)))
+ ignore (B.is_set s (-19))))
module IS = Set.Make (struct type t = int let compare = compare end)
@@ -383,7 +383,7 @@ let test_enum_regr_pz () =
()
-let () =
+let register () =
Util.register "BitSet" [
"basic", test_bs_1;
"enum_1", test_enum_1;
diff --git a/test/test_Dllist.ml b/test/test_Dllist.ml
index 20466c4..504dde8 100644
--- a/test/test_Dllist.ml
+++ b/test/test_Dllist.ml
@@ -54,7 +54,7 @@ let skip_both_ways () =
assert (Dllist.get (Dllist.skip lm 1) = "right");
assert (Dllist.get (Dllist.skip lm (-1)) = "left") (* returned right *)
-let () =
+let register () =
Util.register "Dllist" [
"simple", test_simple;
"regression_1", test_regression_1;
diff --git a/test/test_DynArray.ml b/test/test_DynArray.ml
index b643d01..83b216f 100644
--- a/test/test_DynArray.ml
+++ b/test/test_DynArray.ml
@@ -48,7 +48,7 @@ let test_insert () =
assert (i = DynArray.length !d);
(* This is needed in order to expose the memory corruption. *)
Printf.ifprintf stdout "%d %d\n" i (DynArray.length !d); flush stdout;
- DynArray.insert !d 0 (Array.create 42 "")
+ DynArray.insert !d 0 (Array.make 42 "")
done
(* Issue 2: Error in DynArray exponential resizer *)
@@ -64,7 +64,7 @@ let test_dynarray2 () =
DynArray.add a i
done
-let () =
+let register () =
Util.register "DynArray" [
"triv", test_triv;
"regr_1", test_regr_1;
diff --git a/test/test_ExtArray.ml b/test/test_ExtArray.ml
index 1fbb25b..04f945f 100644
--- a/test/test_ExtArray.ml
+++ b/test/test_ExtArray.ml
@@ -137,7 +137,7 @@ let test_map2 () =
assert (try let _ = Array.map2 (+) [||] [|1|] in false with Invalid_argument _ -> true);
assert (Array.map2 (-) a b = Array.of_list (List.map2 (-) (Array.to_list a) (Array.to_list b)))
-let () =
+let register () =
Util.register "ExtArray" [
"rev", test_rev;
"rev_in_place", test_rev_in_place;
diff --git a/test/test_ExtHashtbl.ml b/test/test_ExtHashtbl.ml
index 01070f3..45df8a7 100644
--- a/test/test_ExtHashtbl.ml
+++ b/test/test_ExtHashtbl.ml
@@ -29,5 +29,5 @@ let test_map () =
assert (find h "test" = Some 1);
assert (find h1 "test" = Some 2)
-let () =
+let register () =
Util.register1 "ExtHashtbl" "map" test_map
diff --git a/test/test_ExtList.ml b/test/test_ExtList.ml
index 731ee98..f120c55 100644
--- a/test/test_ExtList.ml
+++ b/test/test_ExtList.ml
@@ -67,10 +67,10 @@ let test_find_exc () =
let rnd_elem = Random.int (List.length lst) in
assert (check_exn
(fun () ->
- List.find_exc (fun e -> e = List.length lst) Test_Exception lst));
+ ignore (List.find_exc (fun e -> e = List.length lst) Test_Exception lst)));
assert (not (check_exn
(fun () ->
- List.find_exc (fun e -> e = rnd_elem) Test_Exception lst)))
+ ignore (List.find_exc (fun e -> e = rnd_elem) Test_Exception lst))))
end
done
with _ -> assert false
@@ -162,7 +162,7 @@ let test_make () =
let l = List.make 10_000_000 1 in
assert (List.length l = 10_000_000)
-let () =
+let register () =
Util.register "ExtList" [
"iteri", test_iteri;
"mapi", test_mapi;
diff --git a/test/test_ExtString.ml b/test/test_ExtString.ml
index b8fcfa8..e89bf22 100644
--- a/test/test_ExtString.ml
+++ b/test/test_ExtString.ml
@@ -80,7 +80,7 @@ let t_split () =
(* Insert separator and split based on that *)
let modified =
let b = Bytes.of_string s' in
- b.[rpos] <- '|';
+ Bytes.set b rpos '|';
Bytes.to_string b
in
let (half1, half2) = String.split modified "|" in
@@ -123,7 +123,7 @@ let t_nsplit () =
assert (S.nsplit s "te" = ["";"stsui";""]);
assert (try let _ = S.nsplit s "" in false with Invalid_string -> true)
-let () =
+let register () =
Util.register "ExtString" [
"starts_with", t_starts_with;
"ends_with", t_ends_with;
diff --git a/test/test_IO.ml b/test/test_IO.ml
index bb9126e..965f556 100644
--- a/test/test_IO.ml
+++ b/test/test_IO.ml
@@ -104,7 +104,7 @@ let test_bits () =
assert (value = (0b111_1111_1111_1111_1111_1111_1111_1111));
()
-let () =
+let register () =
Util.register1 "IO" "i32" test_i32;
Util.register1 "IO" "real_i32" test_real_i32;
Util.register1 "IO" "i31" test_i31;
diff --git a/test/util.ml b/test/util.ml
index 1220f40..57c5477 100644
--- a/test/util.ml
+++ b/test/util.ml
@@ -29,20 +29,20 @@ let random_char () =
let random_string () =
let len = Random.int 256 in
- let str = String.create len in
+ let str = Bytes.create len in
if len > 0 then
for i = 0 to (len-1) do
- str.[i] <- random_char ()
+ Bytes.set str i (random_char ())
done;
Bytes.unsafe_to_string str
let random_string_len len =
let len = len in
- let str = String.create len in
+ let str = Bytes.create len in
if len > 0 then
for i = 0 to (len-1) do
- str.[i] <- random_char ()
+ Bytes.set str i (random_char ())
done;
Bytes.unsafe_to_string str
@@ -90,7 +90,7 @@ let run_all filter =
let allowed name =
match filter with
| None -> true
- | Some l -> List.mem (String.lowercase name) l
+ | Some l -> List.mem (ExtString.String.lowercase name) l
in
g_test_run_count := 0;
g_test_success_count := 0;
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/lib/debug/.build-id/2c/38c5e0a5bd2f8af4e16572e5b6a1b273ff6614.debug
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/lib/debug/.build-id/df/d92b09a4c8611ff4f242295e290aff36820bda.debug
Control files of package libextlib-ocaml: lines which differ (wdiff format)
Provides: libextlib-ocaml-mvki9 libextlib-ocaml-6pcd0
Control files of package libextlib-ocaml-dbgsym: lines which differ (wdiff format)
Build-Ids: dfd92b09a4c8611ff4f242295e290aff36820bda 2c38c5e0a5bd2f8af4e16572e5b6a1b273ff6614
Control files of package libextlib-ocaml-dev: lines which differ (wdiff format)
Depends: libextlib-ocaml-mvki9, libextlib-ocaml-6pcd0, ocaml-4.13.1
Provides: libextlib-ocaml-dev-mvki9 libextlib-ocaml-dev-6pcd0