Add visual regression test for leading tabs in text#8534
Add visual regression test for leading tabs in text#8534Omar-2718 wants to merge 1 commit intoprocessing:dev-2.0from
Conversation
| visualTest('Preserve leading tabs',function (p5, screenshot){ | ||
| p5.createCanvas(100, 100); | ||
| p5.textSize(35); | ||
| p5.text('test\n\ttest', 0, 0, p5.width, p5.height); |
There was a problem hiding this comment.
Hi! This wasn't generated with @dhowe's changes in, right? I'm wondering why the screenshot shows the tab having an effect, when it's the buggy code still generating the visual. @Omar-2718 in your browser this was still showing incorrect behaviour right? If you mirror that test more closely here (e.g. with a space before the \n? not sure if that's significant) do you see the screenshot starting to show the incorrect behaviour?
In general I'd expect to see the screenshot show incorrect results, and then only after @dhowe's code is merged, would we be able to lock in the correct behaviour in a screenshot.
There was a problem hiding this comment.
I used @dhowe's code to generate the screenshot (as that is the supposed correct answer for the test case) so that my version (the one that isnt working) fails that test. My bad,
So I'm supposed to push the screenshot of my failing code(it fails with 'test\n\ttest' ) before @dhowe's changes, right? And only after @dhowe's pull is merged, update the screenshot
There was a problem hiding this comment.
ah ok, that makes sense then! although I'm also curious why CI says that the tests are paying even though this PR doesn't include the fixes yet... in any case, we should merge this after the fix is in.
There was a problem hiding this comment.
Yeah thats weird, this image is from the CI visual-test-report and somehow passes. When I run it locally, it fails normally. I'm not sure if this behaviour is because of font differences between Ubuntu on the CI and Windows that generated the test image. Or the difference threshold to make the test pass is too big. I can look into it
Addresses #8469
Changes:
Added screen shots for the required result in \test\unit\visual\screenshots\Typography\textFont\Preserve leading tabs
and added regression test to test if the tap renders in a text with text('test\n\ttest', 0, 0, p5.width, p5.height)
Screenshots of the change:
PR Checklist
npm run lintpasses