summaryrefslogtreecommitdiffstats
path: root/tests/core
diff options
context:
space:
mode:
authorThaddeus Crews <repiteo@outlook.com>2024-11-21 17:57:01 -0600
committerThaddeus Crews <repiteo@outlook.com>2024-11-21 17:57:01 -0600
commitf952bfe9985ad8f507cc29b2c7601bbba18b8039 (patch)
treebc70c21014ebde876f4c06c357ddd248817fa9a7 /tests/core
parent0d8352bd968833e3fde6488ac4ff5210b651645e (diff)
parent6f4fadf65def83a6a6c885e4aaa11f8982f37916 (diff)
downloadredot-engine-f952bfe9985ad8f507cc29b2c7601bbba18b8039.tar.gz
Merge pull request #98972 from dbnicholson/standardize-add-defaults
Expose `TranslationServer::standardize_locale` `add_default` param publicly
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/string/test_translation_server.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/core/string/test_translation_server.h b/tests/core/string/test_translation_server.h
index 6668a7b57b..1274d8810e 100644
--- a/tests/core/string/test_translation_server.h
+++ b/tests/core/string/test_translation_server.h
@@ -104,6 +104,36 @@ TEST_CASE("[TranslationServer] Locale operations") {
res = ts->standardize_locale(loc);
CHECK(res == "de_DE");
+
+ // No added defaults.
+ loc = "es_ES";
+ res = ts->standardize_locale(loc, true);
+
+ CHECK(res == "es_ES");
+
+ // Add default script.
+ loc = "az_AZ";
+ res = ts->standardize_locale(loc, true);
+
+ CHECK(res == "az_Latn_AZ");
+
+ // Add default country.
+ loc = "pa_Arab";
+ res = ts->standardize_locale(loc, true);
+
+ CHECK(res == "pa_Arab_PK");
+
+ // Add default script and country.
+ loc = "zh";
+ res = ts->standardize_locale(loc, true);
+
+ CHECK(res == "zh_Hans_CN");
+
+ // Explicitly don't add defaults.
+ loc = "zh";
+ res = ts->standardize_locale(loc, false);
+
+ CHECK(res == "zh");
}
TEST_CASE("[TranslationServer] Comparing locales") {