ICU-21659 Adding test for exabyte

This commit is contained in:
Shane F. Carr 2021-06-30 16:08:46 -05:00
parent e4e2ae9544
commit 4c35e59bdc
2 changed files with 42 additions and 0 deletions

View file

@ -1130,6 +1130,27 @@ void NumberFormatterApiTest::unitArbitraryMeasureUnits() {
2.4,
u"2.4 Kim");
assertFormatSingle(
u"Extra-large prefix: exabyte",
u"unit/exabyte",
u"unit/exabyte",
NumberFormatter::with()
.unit(MeasureUnit::forIdentifier("exabyte", status)),
Locale("en-GB"),
2.4,
u"2.4 Ebyte");
assertFormatSingle(
u"Extra-large prefix: exabyte (full-name)",
u"unit/exabyte unit-width-full-name",
u"unit/exabyte unit-width-full-name",
NumberFormatter::with()
.unit(MeasureUnit::forIdentifier("exabyte", status))
.unitWidth(UNUM_UNIT_WIDTH_FULL_NAME),
Locale("en-GB"),
2.4,
u"2.4 exabytes");
assertFormatSingle(
u"SI prefix falling back to root: microohm",
u"unit/microohm",

View file

@ -1083,6 +1083,27 @@ public class NumberFormatterApiTest extends TestFmwk {
NumberFormatter.with().unit(MeasureUnit.forIdentifier("kibimeter")),
new ULocale("en-GB"), 2.4, "2.4 Kim");
assertFormatSingle(
"Extra-large prefix: exabyte",
"unit/exabyte",
"unit/exabyte",
NumberFormatter.with()
.unit(MeasureUnit.forIdentifier("exabyte")),
new ULocale("en-GB"),
2.4,
"2.4 Ebyte");
assertFormatSingle(
"Extra-large prefix: exabyte (full-name)",
"unit/exabyte unit-width-full-name",
"unit/exabyte unit-width-full-name",
NumberFormatter.with()
.unit(MeasureUnit.forIdentifier("exabyte"))
.unitWidth(UnitWidth.FULL_NAME),
new ULocale("en-GB"),
2.4,
"2.4 exabytes");
assertFormatSingle("SI prefix falling back to root: microohm", "unit/microohm", "unit/microohm",
NumberFormatter.with().unit(MeasureUnit.forIdentifier("microohm")),
new ULocale("de-CH"), 2.4, "2.4 μΩ");