Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify strictness of color parser (#357) #360

Merged
merged 1 commit into from
Nov 27, 2019

Conversation

kimikage
Copy link
Collaborator

@kimikage kimikage commented Nov 3, 2019

This fixes #357.

  • Modify white space handling
  • Add error message about 8-digit or 4-digit hex notation
  • Add support for some CSS4 notations
  • Add tests
  • Speed up parsing averagely

- Modify white space handling
- Add error message about 8-digit or 4-digit hex notation
- Add support for some CSS4 notations
- Add tests
- Speed up parsing averagely
@kimikage
Copy link
Collaborator Author

kimikage commented Nov 3, 2019

It is not difficult to implement the 8-digit or 4-digit hex notation, but we should settle the issue #353.

@codecov
Copy link

codecov bot commented Nov 3, 2019

Codecov Report

Merging #360 into master will increase coverage by 0.75%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
+ Coverage   76.23%   76.98%   +0.75%     
==========================================
  Files          10       10              
  Lines         808      817       +9     
==========================================
+ Hits          616      629      +13     
+ Misses        192      188       -4
Impacted Files Coverage Δ
src/parse.jl 96.49% <100%> (+8.99%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a43f1c...da305cb. Read the comment docs.

@test_throws ErrorException parse(Colorant, "#FB0A")
@test_throws ErrorException parse(Colorant, "#BAD05")
@test_throws ErrorException parse(Colorant, "#BAD0007")
@test_throws ErrorException parse(Colorant, "#FFBB00AA") # not supported yet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In such cases is @test_broken more appropriate?

Copy link
Collaborator Author

@kimikage kimikage Nov 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, if you (we) have already specified the correct behavior. Throwing the "not supported" error is not a broken behavior now. (Of course, checking the error message might be better.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with it either way, no reason not to merge.

@timholy timholy added this to the 1.0 milestone Nov 22, 2019
@timholy timholy mentioned this pull request Nov 22, 2019
4 tasks
@kimikage
Copy link
Collaborator Author

If this PR causes a problem (e.g. "not supported" error), it is probably a potential bug in the user scripts.
Although this behavior is going to be changed soon, but I will merge this foremost.

@kimikage kimikage merged commit 1bc194e into JuliaGraphics:master Nov 27, 2019
@kimikage
Copy link
Collaborator Author

kimikage commented Nov 27, 2019

Aww, I'm sorry but I mistook this PR number for the issue number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color parser is both strict and loose
2 participants