]> granicus.if.org Git - icu/commitdiff
Add test cases for dropping last component(s) of usage.
authorHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Wed, 27 May 2020 18:04:36 +0000 (20:04 +0200)
committerHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Wed, 27 May 2020 22:13:03 +0000 (00:13 +0200)
icu4c/source/test/intltest/unitsdatatest.cpp

index 64e8c0a25836fe6db5648179528e2880a9237169..4e44e47d0c398a0ffd171326fa5d6e93ebe28e2d 100644 (file)
@@ -103,6 +103,10 @@ void UnitsDataTest::testGetPreferences() {
         {"XX default falls back to 001", "length", "default", "XX", WorldLenMax, WorldLenMin},
         {"Unknown usage US", "length", "foobar", "US", USLenMax, USLenMin},
         {"Unknown usage 001", "length", "foobar", "XX", WorldLenMax, WorldLenMin},
+        {"Fallback", "length", "person-height-xyzzy", "DE", "meter-and-centimeter",
+         "meter-and-centimeter"},
+        {"Fallback twice", "length", "person-height-xyzzy-foo", "DE", "meter-and-centimeter",
+         "meter-and-centimeter"},
     };
     IcuTestErrorCode status(*this, "testGetPreferences");
     UnitPreferencesOpenedUp preferences(status);