DAIP should trim all whitespace
DAIP should trim all whitespace (including NBSPs) from the start and end of all values, and also merge multiple spaces into a single one.
There are some exceptions for very special values (like the grouping separator).
With code changes I have on a branch, test failures occur, such as for:
The winning value is 約 followed by NBSP. Should final NBSP be removed for that path?
Not all “…/currencies/currency/…” paths trigger a test failure. We need one that matches the second “if” in normalizeWhitespace – such as:
With that, the test fails, as intended.
In the spirit of test-driven development, I wrote a test first, adding this method to TestDisplayAndInputProcessor.java:
It already passes. So, either this ticket isn’t needed, or we need a more demanding test.
DisplayAndInputProcessor.processInput includes this:
However, trim only treats as whitespace characters <= U+0020.
However, normalizeWhitespace is called BEFORE trim, so in combination they trim most kinds of whitespace from the start/end of the value.
However, that depends on the path! The test will be more demanding if the path contains "/currencies/currency"…
We already have this:
That shortens/normalizes sequences of whitespace, but doesn’t completely remove whitespace from the start or end.
Affects ICU data, since we run DAIP as part of the release.