@@ -30,11 +30,41 @@ describe('inputs', () => {
30
30
expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[fo\\\\\\]\\\\\\^\\]/' )
31
31
expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[fo\\]\\^]' > ( )
32
32
} )
33
+ it ( 'charIn.orChar' , ( ) => {
34
+ const input = charIn ( 'a' ) . orChar ( 'b' )
35
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[ab\\]/' )
36
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[ab]' > ( )
37
+ } )
38
+ it ( 'charIn.orChar.from' , ( ) => {
39
+ const input = charIn ( 'a' ) . orChar . from ( 'a' , 'b' )
40
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[aa-b\\]/' )
41
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[aa-b]' > ( )
42
+ } )
43
+ it ( 'charIn.from' , ( ) => {
44
+ const input = charIn . from ( 'a' , 'b' )
45
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[a-b\\]/' )
46
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[a-b]' > ( )
47
+ } )
33
48
it ( 'charNotIn' , ( ) => {
34
49
const input = charNotIn ( 'fo^-' )
35
50
expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^fo\\\\\\^\\\\-\\]/' )
36
51
expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^fo\\^\\-]' > ( )
37
52
} )
53
+ it ( 'charNotIn.orChar' , ( ) => {
54
+ const input = charNotIn ( 'a' ) . orChar ( 'b' )
55
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^ab\\]/' )
56
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^ab]' > ( )
57
+ } )
58
+ it ( 'charNotIn.orChar.from' , ( ) => {
59
+ const input = charNotIn ( 'a' ) . orChar . from ( 'a' , 'b' )
60
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^aa-b\\]/' )
61
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^aa-b]' > ( )
62
+ } )
63
+ it ( 'charNotIn.from' , ( ) => {
64
+ const input = charNotIn . from ( 'a' , 'b' )
65
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^a-b\\]/' )
66
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^a-b]' > ( )
67
+ } )
38
68
it ( 'anyOf' , ( ) => {
39
69
const values = [ 'fo/o' , 'bar' , 'baz' , oneOrMore ( 'this' ) ] as const
40
70
const input = anyOf ( ...values )
0 commit comments