-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix v-flag bugs #85
Merged
Merged
Fix v-flag bugs #85
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e30f2eb
replace istanbul ignore comment with node coverage
JLHwung d4b5bdb
support matches and nonMatches in regexp-v-flag tests
JLHwung 2b55fe7
re-use Unicode fixtures in v-flag tests
JLHwung 6cb420e
improve handling character class
JLHwung 8501e5d
make node.js 6 happy
JLHwung d948109
add dot all flag test cases
JLHwung cee1115
remove duplicate property escapes test
JLHwung File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,25 +44,33 @@ const characterClassFixtures = [ | |
{ | ||
pattern: '[^K]', // LATIN CAPITAL LETTER K | ||
flags: 'u', | ||
expected: '(?:[\\0-JL-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])', | ||
matches: ["k", "\u212a", "\u{12345}", "\uDAAA", "\uDDDD"], | ||
nonMatches: ["K"], | ||
expected: '(?:[\\0-JL-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They are now much shorter and easier to reason about. I also added |
||
options: { unicodeFlag: 'transform' } | ||
}, | ||
{ | ||
pattern: '[^k]', // LATIN SMALL LETTER K | ||
flags: 'u', | ||
expected: '(?:[\\0-jl-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])', | ||
matches: ["K", "\u212a", "\u{12345}", "\uDAAA", "\uDDDD"], | ||
nonMatches: ["k"], | ||
expected: '(?:[\\0-jl-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])', | ||
options: { unicodeFlag: 'transform' } | ||
}, | ||
{ | ||
pattern: '[^\u212a]', // KELVIN SIGN | ||
flags: 'u', | ||
expected: '(?:[\\0-\\u2129\\u212B-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])', | ||
matches: ["K", "k", "\u{12345}", "\uDAAA", "\uDDDD"], | ||
nonMatches: ["\u212a"], | ||
expected: '(?:[\\0-\\u2129\\u212B-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF])', | ||
options: { unicodeFlag: 'transform' } | ||
}, | ||
{ | ||
pattern: '[^\u{1D50E}]', // MATHEMATICAL FRAKTUR CAPITAL K | ||
flags: 'u', | ||
expected: '(?:[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uD834\\uD836-\\uDBFF][\\uDC00-\\uDFFF]|\\uD835[\\uDC00-\\uDD0D\\uDD0F-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])', | ||
matches: ["K", "k", "\u{12345}", "\u{1D50F}", "\uDAAA", "\uDDDD"], | ||
nonMatches: ["\u{1D50E}"], | ||
expected: '(?:[\\0-\\uFFFF]|[\\uD800-\\uD834\\uD836-\\uDBFF][\\uDC00-\\uDFFF]|\\uD835[\\uDC00-\\uDD0D\\uDD0F-\\uDFFF])', | ||
options: { unicodeFlag: 'transform' } | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the regenerate set spans from code points before surrogate to astral sets,
toString({ bmpOnly: false })
returns much more verbose results whiletoString({ bmpOnly: false })
is already correct: I think it should be fixed in regenerate later.The latter is apparently correct as it matches lone surrogates as well as U+10000. The former seems like
[\uD000-\uFFFF]|\uD800\uDC00
is passed to the bmp pass again.