Tests: Allow whitespace around fuzzy-matching configurations

Several WPT tests have a space after the semicolon, for example
https://wpt.live/css/css-images/gradient/gradient-single-stop-001.html :

```
<meta name="fuzzy" content="maxDifference=0-1; totalPixels=0-6000">
```
This commit is contained in:
Sam Atkins 2025-08-06 11:51:11 +01:00 committed by Jelle Raaijmakers
commit 9889710033
Notes: github-actions[bot] 2025-08-06 11:53:05 +00:00

View file

@ -79,7 +79,7 @@ ErrorOr<FuzzyMatch> parse_fuzzy_match(Optional<URL::URL const&> reference, Strin
Optional<FuzzyRange> color_value_error; Optional<FuzzyRange> color_value_error;
Optional<FuzzyRange> pixel_error_count; Optional<FuzzyRange> pixel_error_count;
for (auto [i, config_part] : enumerate(config_parts)) { for (auto [i, config_part] : enumerate(config_parts)) {
auto named_parts = MUST(config_part.split_limit('=', 2)); auto named_parts = MUST(MUST(config_part.trim_ascii_whitespace()).split_limit('=', 2));
if (named_parts.is_empty()) if (named_parts.is_empty())
return Error::from_string_view("Fuzzy configuration value cannot be empty"sv); return Error::from_string_view("Fuzzy configuration value cannot be empty"sv);