From 3f88e96395530e55978af5209fbe9e5d50ab3461 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 21 Oct 2024 20:00:09 -0400 Subject: [PATCH] locale: Test string_resolve --- locale/string_test.ha | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 locale/string_test.ha diff --git a/locale/string_test.ha b/locale/string_test.ha new file mode 100644 index 0000000..746aab3 --- /dev/null +++ b/locale/string_test.ha @@ -0,0 +1,18 @@ +@test fn string_resolve() void = { + assert(string_resolve([ + (c, "c"), + (parse("xx_XX")!, "xx_XX"), + ], c) as str == "c"); + assert(string_resolve([ + (c, "c"), + (parse("xx_XX")!, "xx_XX"), + ], parse("xx_XX.UTF-8")!) as str == "xx_XX"); + assert(string_resolve([ + (c, "c"), + (parse("xx_XX")!, "xx_XX"), + ], parse("yy_YY.UTF-8")!) as str == "c"); + assert(string_resolve([ + (parse("xx_XX")!, "xx_XX"), + (parse("zz_ZZ")!, "zz_ZZ"), + ], parse("yy_YY")!) is void); +};