This updates the MF2 spec tests to 943479b602 with the following exceptions:
- functions/currency.json and functions/math.json are omitted because these are not yet implemented
- bidi.json will be handled in a future PR
- u-options.json will be handled in a future PR
Changes include:
* `:integer` now returns a value encapsulating the rounded numeric value of the argument, rather than
the value itself.
* Fallbacks are handled according to the current spec.
* Fallback values are not passed into functions.
* Characters inside literal fallbacks are properly escaped.
* The test runner skips null values properly.
* The test runner handles boolean `expErrors` in defaultTestProperties.
* `:string` normalizes its input and normalizeNFC() has been refactored so it can be called there.
Inside of locimp_forLanguageTag() in _appendKeywords() in uloc_tag.cpp
there's a hardcoded special case for "-u-va-posix" which appends the
"_POSIX" variant but this was missed during the refactoring made for
ICU-22520 (there isn't any test case that covers this).
So the call to locimp_forLanguageTag() did more than previously
understood, but we still don't want to have to call that for every
language tag that has BCP-47 extensions just in order to get to this
special case. Instead, add a special case also to ulocimp_getSubtags().
For this to work nicely, the loop in _getVariant() that copies variants
needs to be refactored so that it easily can break when encountering the
start of any BCP-47 extension (which also has the welcome side-effect of
making it more efficient, being able to append an entire variant at once
to the output sink).
This was broken by commit 678d5c1273.
- Expanded test cases for portion unit formatting
- Added support for different locales (en-US, de-DE)
- Improved test coverage for portion unit formatting
- Added handling for known CLDR data limitations
Implement :test:format, :test:select, and :test:function, which are
required by the new `pattern-selection.json` tests.
Change the internal value representation in the formatter in order to
support some of the test cases (binding the results of selectors to a
variable).
resolveCurrency() slows down simple number formatting requests like:
for (int i = 0; i < 9999; i++) u_snprintf_u(buff, 100, u"%d", i);
Since we don't use currency here, we can skip its initialization.
Until now, the implementation of the UCollator predicates has been using
UnicodeString and StringPiece as convenient wrappers for converting from
standard C++ data types to ICU4C data types.
But as that doesn't work when the client uses ICU4C built without
U_SHOW_CPLUSPLUS_API this is now changed to instead perform these
conversions directly.
(It's a bit more code, but does just the same thing in the end.)