From 1a4afd5d411a035d68f1f40b97223404f4722c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Proust?= Date: Tue, 29 Aug 2023 15:38:23 +0200 Subject: [PATCH] Adding tests to make sure things work --- dune-project | 1 + test/dune | 8 ++++++-- test/stringCodepointSplitter.ml | 0 test/stringCodepointSplitter.t | 11 +++++++++++ test/stringCodepointSplitterTest.ml | 4 ++++ 5 files changed, 22 insertions(+), 2 deletions(-) delete mode 100644 test/stringCodepointSplitter.ml create mode 100644 test/stringCodepointSplitter.t create mode 100644 test/stringCodepointSplitterTest.ml 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/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