diff options
author | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-04 13:11:14 -0500 |
---|---|---|
committer | Nick Zolnierz <nicholas.zolnierz@mongodb.com> | 2019-01-04 16:03:21 -0500 |
commit | e3eaddbf01d4c0939370b117a44b60069b68158e (patch) | |
tree | 76d0fbb147d4ceeddf7d857d1cfb7407a4007e5b /src/mongo/db/query/collation | |
parent | b83813667df5d783e7f34bea069d8d586946e563 (diff) | |
download | mongo-e3eaddbf01d4c0939370b117a44b60069b68158e.tar.gz |
SERVER-38840 ICU parsing does not gracefully handle invalid id-prefixed locales
Diffstat (limited to 'src/mongo/db/query/collation')
-rw-r--r-- | src/mongo/db/query/collation/collator_factory_icu_test.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/query/collation/collator_factory_icu_test.cpp b/src/mongo/db/query/collation/collator_factory_icu_test.cpp index bb3f2f92a32..ce1b051df13 100644 --- a/src/mongo/db/query/collation/collator_factory_icu_test.cpp +++ b/src/mongo/db/query/collation/collator_factory_icu_test.cpp @@ -1222,4 +1222,15 @@ TEST(CollatorFactoryICUTest, TraditionalSpanishAliasNotSupported) { .getStatus()); } +TEST(CollatorFactoryICUTest, InvalidIdPrefixedLocaleFailsGracefully) { + CollatorFactoryICU factory; + auto collator = factory.makeFromBSON(BSON("locale" + << "x_test")); + ASSERT_NOT_OK(collator.getStatus()); + + collator = factory.makeFromBSON(BSON("locale" + << "I-test")); + ASSERT_NOT_OK(collator.getStatus()); +} + } // namespace |