Repository navigation
Conversation
Fix parsing color strings in hexadecimal notation with 7 character successfully. This is caused by the sRGB color space's tex test regexp allowing a match of 3 valid characters followed by a match of 4 valid characters (and vice-versa). The fix is done by separating the regexp for the collpased and non-collapsed forms. Add four tests for invalid hex color strings with invalid lengths. Three of them (those for 2, 5, and 9 characters) pass without this fix. Only the one for 7 characters doesn't already.
β Deploy Preview for colorjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@DmitrySharabin could you please investigate if this is an hTest bug? |
LeaVerou
left a comment
There was a problem hiding this comment.
The change LGTM, thank you! Someone should run the tests before merging though.
The tests pass |
I pushed a commit to upgrade to the latest version of htest. @kleinfreund can you try running the tests again with the latest version of htest. I'm guessing the tests will still fail but it's worth giving it a shot. |
It turned out that there is a known issue with paths when used in dynamic |
It should be fixed now in the latest version of hTest (v0.0.16). |
I can confirm that running |
Changes
Fix parsing color strings in hexadecimal notation with 7 character successfully. This is caused by the sRGB color space's hex test regexp allowing a match of 3 valid characters followed by a match of 4 valid characters (and vice-versa). The fix is done by separating the regexp for the collapsed and non-collapsed forms.
Add four tests for invalid hex color strings with invalid lengths. Three of them (those for 2, 5, and 9 characters) pass without this fix. Only the one for 7 characters doesn't already.
Notes
Error importing tests from C:\Users\phil\dev\color.js\test\adapt.js: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'error for all test files. In my Ubuntu environment, they work however. It looks like there might be a dynamic import somewhere that is fed with ac:\...-style path but I couldn't find it in this repository or htest.