@@ -12,11 +12,41 @@ describe('inputs', () => {
12
12
expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[fo\\\\\\]\\\\\\^\\]/' )
13
13
expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[fo\\]\\^]' > ( )
14
14
} )
15
+ it ( 'charIn.orChar' , ( ) => {
16
+ const input = charIn ( 'a' ) . orChar ( 'b' )
17
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[ab\\]/' )
18
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[ab]' > ( )
19
+ } )
20
+ it ( 'charIn.orChar.from' , ( ) => {
21
+ const input = charIn ( 'a' ) . orChar . from ( 'a' , 'b' )
22
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[aa-b\\]/' )
23
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[aa-b]' > ( )
24
+ } )
25
+ it ( 'charIn.from' , ( ) => {
26
+ const input = charIn . from ( 'a' , 'b' )
27
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[a-b\\]/' )
28
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[a-b]' > ( )
29
+ } )
15
30
it ( 'charNotIn' , ( ) => {
16
31
const input = charNotIn ( 'fo^-' )
17
32
expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^fo\\\\\\^\\\\-\\]/' )
18
33
expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^fo\\^\\-]' > ( )
19
34
} )
35
+ it ( 'charNotIn.orChar' , ( ) => {
36
+ const input = charNotIn ( 'a' ) . orChar ( 'b' )
37
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^ab\\]/' )
38
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^ab]' > ( )
39
+ } )
40
+ it ( 'charNotIn.orChar.from' , ( ) => {
41
+ const input = charNotIn ( 'a' ) . orChar . from ( 'a' , 'b' )
42
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^aa-b\\]/' )
43
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^aa-b]' > ( )
44
+ } )
45
+ it ( 'charNotIn.from' , ( ) => {
46
+ const input = charNotIn . from ( 'a' , 'b' )
47
+ expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^a-b\\]/' )
48
+ expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^a-b]' > ( )
49
+ } )
20
50
it ( 'anyOf' , ( ) => {
21
51
const values = [ 'fo/o' , 'bar' , 'baz' , oneOrMore ( 'this' ) ] as const
22
52
const input = anyOf ( ...values )
0 commit comments