Skip to content

Commit

Permalink
feat: added valid cases
Browse files Browse the repository at this point in the history
  • Loading branch information
togami2864 committed Nov 27, 2023
1 parent 872e648 commit adcb3b4
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/biome_js_analyze/tests/spec_tests.rs
assertion_line: 83
expression: invalid.js
---
# Input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,44 @@
/^[abc]$/;
/^[👍]$/u;
/^[\q{👶🏻}]$/v;
/^[\q{👶🏻}]$/v;
/[👍]/u
/[\\uD83D\\uDC4D]/u
/[\\u{1F44D}]/u
/❇️/
//
/[]/
/👶🏻/
/[👶]/u
/🇯🇵/
/[JP]/
/👨‍👩‍👦/

// Ignore solo lead/tail surrogate.
/[\\uD83D]/
/[\\uDC4D]/
/[\\uD83D]/u
/[\\uDC4D]/u

// // Ignore solo combining char.
/[\\u0301]/
/[\\uFE0F]/
/[\\u0301]/u
/[\\uFE0F]/u

// Ignore solo emoji modifier.
/[\\u{1F3FB}]/u
/[\u{1F3FB}]/u

// Ignore solo regional indicator symbol.
/[🇯]/u
/[🇵]/u

// Ignore solo ZWJ.
/[\\u200D]/
/[\\u200D]/u

// don't report and don't crash on invalid regex
new RegExp('[Á] [ ');
RegExp('{ [Á]' 'u');
new globalThis.RegExp('[Á] [ ')
globalThis.RegExp('{ [Á]', 'u')
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
source: crates/biome_js_analyze/tests/spec_tests.rs
expression: valid.js
---
# Input
```js
/^[abc]$/;
/^[👍]$/u;
/^[\q{👶🏻}]$/v;
/[👍]/u
/[\\uD83D\\uDC4D]/u
/[\\u{1F44D}]/u
/❇️/
//
/[❇]/
/👶🏻/
/[👶]/u
/🇯🇵/
/[JP]/
/👨‍👩‍👦/

// Ignore solo lead/tail surrogate.
/[\\uD83D]/
/[\\uDC4D]/
/[\\uD83D]/u
/[\\uDC4D]/u

// // Ignore solo combining char.
/[\\u0301]/
/[\\uFE0F]/
/[\\u0301]/u
/[\\uFE0F]/u

// Ignore solo emoji modifier.
/[\\u{1F3FB}]/u
/[\u{1F3FB}]/u

// Ignore solo regional indicator symbol.
/[🇯]/u
/[🇵]/u

// Ignore solo ZWJ.
/[\\u200D]/
/[\\u200D]/u

// don't report and don't crash on invalid regex
new RegExp('[Á] [ ');
RegExp('{ [Á]' 'u');
new globalThis.RegExp('[Á] [ ')
globalThis.RegExp('{ [Á]', 'u')
```


This file was deleted.

0 comments on commit adcb3b4

Please sign in to comment.