From 047139a2d70a4d3886af465b537743d3d495d714 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Fri, 31 Mar 2017 13:50:36 +0100 Subject: [PATCH] Added tests for Map.of_alist_multi --- test/expect-tests/import_dot_map.mlt | 20 ++++++++++++++++++++ test/expect-tests/jbuild | 7 +++++++ 2 files changed, 27 insertions(+) create mode 100644 test/expect-tests/import_dot_map.mlt diff --git a/test/expect-tests/import_dot_map.mlt b/test/expect-tests/import_dot_map.mlt new file mode 100644 index 00000000..090578ae --- /dev/null +++ b/test/expect-tests/import_dot_map.mlt @@ -0,0 +1,20 @@ +(* -*- tuareg -*- *) + +#warnings "-40";; + +open Jbuilder;; +open Import;; + +(* Check that [of_alist_multi] groups elements in the right order *) +String_map.of_alist_multi + [ "a", 1 + ; "b", 1 + ; "a", 2 + ; "a", 3 + ; "b", 2 + ] +|> String_map.bindings;; +[%%expect{| +- : (Jbuilder.Import.String_map.key * int list) list = +[("a", [1; 2; 3]); ("b", [1; 2])] +|}] diff --git a/test/expect-tests/jbuild b/test/expect-tests/jbuild index 908ec100..d77f5b37 100644 --- a/test/expect-tests/jbuild +++ b/test/expect-tests/jbuild @@ -22,3 +22,10 @@ (glob_files ${ROOT}/src/*.cmi) (glob_files ${ROOT}/vendor/re/*.cmi))) (action (chdir ${ROOT} (run ${exe:expect_test.bc} ${<}))))) + +(alias + ((name runtest) + (deps (import_dot_map.mlt + (glob_files ${ROOT}/src/*.cmi) + (glob_files ${ROOT}/vendor/re/*.cmi))) + (action (chdir ${ROOT} (run ${exe:expect_test.bc} ${<})))))