@@ -12,11 +12,41 @@ describe('inputs', () => {
1212 expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[fo\\\\\\]\\\\\\^\\]/' )
1313 expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[fo\\]\\^]' > ( )
1414 } )
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+ } )
1530 it ( 'charNotIn' , ( ) => {
1631 const input = charNotIn ( 'fo^-' )
1732 expect ( new RegExp ( input as any ) ) . toMatchInlineSnapshot ( '/\\[\\^fo\\\\\\^\\\\-\\]/' )
1833 expectTypeOf ( extractRegExp ( input ) ) . toEqualTypeOf < '[^fo\\^\\-]' > ( )
1934 } )
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+ } )
2050 it ( 'anyOf' , ( ) => {
2151 const values = [ 'fo/o' , 'bar' , 'baz' , oneOrMore ( 'this' ) ] as const
2252 const input = anyOf ( ...values )
0 commit comments