Skip to content

Commit

Permalink
test(CssFilters): Avoid asserting 4000 times
Browse files Browse the repository at this point in the history
  • Loading branch information
bruyeret authored and finetjul committed Feb 8, 2024
1 parent 407de24 commit 6f62bc6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ test('Fuzzy test all CssFilters', (t) => {
const error = referenceOutput[channel] - filtersOutput[channel];
// The error depends on the values of each filter
// For example, using a color of [127.5, 127.5, 128.49] with a saturate of 1000 creates big errors
t.assert(Math.abs(error) <= 7 / 255);
// This is because the CSS filters use uint8 instead of floating point numbers
if (Math.abs(error) > 7 / 255) {
t.fail('Error is too big');
}
}
}
t.end();
Expand Down

0 comments on commit 6f62bc6

Please sign in to comment.