66 charRange ,
77 digit ,
88 inverted ,
9- notDigit ,
10- notWhitespace ,
11- notWord ,
9+ nonDigit ,
10+ nonWhitespace ,
11+ nonWord ,
1212 oneOrMore ,
1313 optional ,
1414 whitespace ,
@@ -30,12 +30,12 @@ test('`digit` character class', () => {
3030 expect ( digit ) . not . toMatchString ( 'A' ) ;
3131} ) ;
3232
33- test ( '`notDigit ` character class' , ( ) => {
34- expect ( notDigit ) . toEqualRegex ( / \D / ) ;
35- expect ( [ 'x' , notDigit ] ) . toEqualRegex ( / x \D / ) ;
36- expect ( [ 'x' , notDigit , 'x' ] ) . toEqualRegex ( / x \D x / ) ;
37- expect ( notDigit ) . not . toMatchString ( '1' ) ;
38- expect ( notDigit ) . toMatchString ( 'A' ) ;
33+ test ( '`nonDigit ` character class' , ( ) => {
34+ expect ( nonDigit ) . toEqualRegex ( / \D / ) ;
35+ expect ( [ 'x' , nonDigit ] ) . toEqualRegex ( / x \D / ) ;
36+ expect ( [ 'x' , nonDigit , 'x' ] ) . toEqualRegex ( / x \D x / ) ;
37+ expect ( nonDigit ) . not . toMatchString ( '1' ) ;
38+ expect ( nonDigit ) . toMatchString ( 'A' ) ;
3939} ) ;
4040
4141test ( '`word` character class' , ( ) => {
@@ -47,13 +47,13 @@ test('`word` character class', () => {
4747 expect ( word ) . not . toMatchString ( '$' ) ;
4848} ) ;
4949
50- test ( '`notWord ` character class' , ( ) => {
51- expect ( notWord ) . toEqualRegex ( / \W / ) ;
52- expect ( [ 'x' , notWord ] ) . toEqualRegex ( / x \W / ) ;
53- expect ( [ 'x' , notWord , 'x' ] ) . toEqualRegex ( / x \W x / ) ;
54- expect ( notWord ) . not . toMatchString ( 'A' ) ;
55- expect ( notWord ) . not . toMatchString ( '1' ) ;
56- expect ( notWord ) . toMatchString ( '$' ) ;
50+ test ( '`nonWord ` character class' , ( ) => {
51+ expect ( nonWord ) . toEqualRegex ( / \W / ) ;
52+ expect ( [ 'x' , nonWord ] ) . toEqualRegex ( / x \W / ) ;
53+ expect ( [ 'x' , nonWord , 'x' ] ) . toEqualRegex ( / x \W x / ) ;
54+ expect ( nonWord ) . not . toMatchString ( 'A' ) ;
55+ expect ( nonWord ) . not . toMatchString ( '1' ) ;
56+ expect ( nonWord ) . toMatchString ( '$' ) ;
5757} ) ;
5858
5959test ( '`whitespace` character class' , ( ) => {
@@ -66,14 +66,14 @@ test('`whitespace` character class', () => {
6666 expect ( whitespace ) . not . toMatchString ( '1' ) ;
6767} ) ;
6868
69- test ( '`notWhitespace ` character class' , ( ) => {
70- expect ( notWhitespace ) . toEqualRegex ( / \S / ) ;
71- expect ( [ 'x' , notWhitespace ] ) . toEqualRegex ( / x \S / ) ;
72- expect ( [ 'x' , notWhitespace , 'x' ] ) . toEqualRegex ( / x \S x / ) ;
73- expect ( notWhitespace ) . not . toMatchString ( ' ' ) ;
74- expect ( notWhitespace ) . not . toMatchString ( '\t' ) ;
75- expect ( notWhitespace ) . toMatchString ( 'A' ) ;
76- expect ( notWhitespace ) . toMatchString ( '1' ) ;
69+ test ( '`nonWhitespace ` character class' , ( ) => {
70+ expect ( nonWhitespace ) . toEqualRegex ( / \S / ) ;
71+ expect ( [ 'x' , nonWhitespace ] ) . toEqualRegex ( / x \S / ) ;
72+ expect ( [ 'x' , nonWhitespace , 'x' ] ) . toEqualRegex ( / x \S x / ) ;
73+ expect ( nonWhitespace ) . not . toMatchString ( ' ' ) ;
74+ expect ( nonWhitespace ) . not . toMatchString ( '\t' ) ;
75+ expect ( nonWhitespace ) . toMatchString ( 'A' ) ;
76+ expect ( nonWhitespace ) . toMatchString ( '1' ) ;
7777} ) ;
7878
7979test ( '`charClass` base cases' , ( ) => {
@@ -173,22 +173,22 @@ test('`encodeCharacterClass` throws on empty text', () => {
173173} ) ;
174174
175175test ( 'showcase: negated character classes' , ( ) => {
176- expect ( notDigit ) . toEqualRegex ( / \D / ) ;
177- expect ( notWord ) . toEqualRegex ( / \W / ) ;
178- expect ( notWhitespace ) . toEqualRegex ( / \S / ) ;
179-
180- expect ( notDigit ) . toMatchString ( 'A' ) ;
181- expect ( notDigit ) . not . toMatchString ( '1' ) ;
182- expect ( notDigit ) . toMatchString ( ' ' ) ;
183- expect ( notDigit ) . toMatchString ( '#' ) ;
184-
185- expect ( notWord ) . not . toMatchString ( 'A' ) ;
186- expect ( notWord ) . not . toMatchString ( '1' ) ;
187- expect ( notWord ) . toMatchString ( ' ' ) ;
188- expect ( notWord ) . toMatchString ( '#' ) ;
189-
190- expect ( notWhitespace ) . toMatchString ( 'A' ) ;
191- expect ( notWhitespace ) . toMatchString ( '1' ) ;
192- expect ( notWhitespace ) . not . toMatchString ( ' ' ) ;
193- expect ( notWhitespace ) . toMatchString ( '#' ) ;
176+ expect ( nonDigit ) . toEqualRegex ( / \D / ) ;
177+ expect ( nonWord ) . toEqualRegex ( / \W / ) ;
178+ expect ( nonWhitespace ) . toEqualRegex ( / \S / ) ;
179+
180+ expect ( nonDigit ) . toMatchString ( 'A' ) ;
181+ expect ( nonDigit ) . not . toMatchString ( '1' ) ;
182+ expect ( nonDigit ) . toMatchString ( ' ' ) ;
183+ expect ( nonDigit ) . toMatchString ( '#' ) ;
184+
185+ expect ( nonWord ) . not . toMatchString ( 'A' ) ;
186+ expect ( nonWord ) . not . toMatchString ( '1' ) ;
187+ expect ( nonWord ) . toMatchString ( ' ' ) ;
188+ expect ( nonWord ) . toMatchString ( '#' ) ;
189+
190+ expect ( nonWhitespace ) . toMatchString ( 'A' ) ;
191+ expect ( nonWhitespace ) . toMatchString ( '1' ) ;
192+ expect ( nonWhitespace ) . not . toMatchString ( ' ' ) ;
193+ expect ( nonWhitespace ) . toMatchString ( '#' ) ;
194194} ) ;
0 commit comments