diff --git a/dune-project b/dune-project index f63ebd6..428891d 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,5 @@ (lang dune 3.9) +(cram enable) (name stringCodepointSplitter) (version 0.0.1) diff --git a/lib/dune b/lib/dune index 7ae24b9..152dbb8 100644 --- a/lib/dune +++ b/lib/dune @@ -1,4 +1,4 @@ (library (name stringCodepointSplitter) (public_name stringCodepointSplitter) - (libraries uutf findlib.dynload)) + (libraries uutf)) diff --git a/lib/stringCodepointSplitter.ml b/lib/stringCodepointSplitter.ml index fa24c05..3c8b223 100644 --- a/lib/stringCodepointSplitter.ml +++ b/lib/stringCodepointSplitter.ml @@ -13,9 +13,6 @@ Under MIT License It only contains [split_string_by_unicode_codepoint], which splits an OCaml string [str] to a [string list] *) -let _ = Findlib.init ();; -Fl_dynload.load_packages ["uutf"];; - (** Split an OCaml string [str] to a [string list] diff --git a/test/dune b/test/dune index abafc95..0caa2b6 100644 --- a/test/dune +++ b/test/dune @@ -1,2 +1,6 @@ -(test - (name stringCodepointSplitter)) +(executable + (libraries stringCodepointSplitter) + (name stringCodepointSplitterTest)) + +(cram + (deps ./stringCodepointSplitterTest.exe)) diff --git a/test/stringCodepointSplitter.ml b/test/stringCodepointSplitter.ml deleted file mode 100644 index e69de29..0000000 diff --git a/test/stringCodepointSplitter.t b/test/stringCodepointSplitter.t new file mode 100644 index 0000000..f50da59 --- /dev/null +++ b/test/stringCodepointSplitter.t @@ -0,0 +1,11 @@ +ASCII only + $ ./stringCodepointSplitterTest.exe abc + a + b + c + +Still simple but not just ASCII + $ ./stringCodepointSplitterTest.exe «—» + « + — + » diff --git a/test/stringCodepointSplitterTest.ml b/test/stringCodepointSplitterTest.ml new file mode 100644 index 0000000..76105fe --- /dev/null +++ b/test/stringCodepointSplitterTest.ml @@ -0,0 +1,4 @@ +let () = + Sys.argv.(1) + |> StringCodepointSplitter.split_string_by_unicode_codepoint + |> List.iter print_endline