Skip to content

Consider providing test functionality for ignoring whitespace in strings #177478

@Piinks

Description

@Piinks

(Super) debatable, but we might consider adding testing functionality that will allow string matching while ignoring whitespace.

We have been looking at how to best roll in updates to date localizations that have (in a few cases) updated typical whitespace (U+0020) to be NBSP (non breaking space, U+202F). The localizations team confirmed this is WAI, and in some locales (like French) is a required typography rule.

We have found users' might experience this update like this:

Image

Which would be super frustrating to debug! We are working on improving the error message here to specify the whitespace character in the error message, #177479, but also discussed that in some cases (maybe not this particular case) users might like a test method that allows them to match strings without attention paid to whitespace. Like this:

expect(testString, matchesIgnoringWhitespace(expectedString));

A little bit more context on this from the localizations team is available in b/442629033

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)a: tests"flutter test", flutter_test, or one of our teststeam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions