@@ -76,6 +76,37 @@ describe('Builder Test', () => {
76
76
assert . equal ( matches [ 1 ] , 'green' )
77
77
} )
78
78
79
+ it ( 'More Methods' , ( ) => {
80
+ const regex = new SRL ( )
81
+ . noWhitespace ( )
82
+ . literally ( 'a' )
83
+ . ifFollowedBy ( ( builder ) => {
84
+ return builder . noCharacter ( )
85
+ } )
86
+ . tab ( )
87
+ . mustEnd ( )
88
+ . multiLine ( )
89
+ . get ( )
90
+ const target = `
91
+ ba\t
92
+ aaabbb
93
+ `
94
+ assert . ok ( regex . test ( target ) )
95
+
96
+ const regex2 = new SRL ( )
97
+ . startsWith ( )
98
+ . literally ( 'a' )
99
+ . newLine ( )
100
+ . whitespace ( )
101
+ . onceOrMore ( )
102
+ . literally ( 'b' )
103
+ . mustEnd ( )
104
+ . get ( )
105
+ const target2 = `a
106
+ b`
107
+ assert . ok ( regex2 . test ( target2 ) )
108
+ } )
109
+
79
110
it ( 'Replace' , ( ) => {
80
111
const regex = new SRL ( )
81
112
. capture ( ( query ) => {
@@ -107,6 +138,17 @@ describe('Builder Test', () => {
107
138
const matches = ',, ' . match ( regex )
108
139
assert . equal ( matches [ 1 ] , ',,' )
109
140
assert . notEqual ( matches [ 1 ] , ',, ' )
141
+
142
+ const regex2 = new SRL ( )
143
+ . literally ( ',' )
144
+ . atLeast ( 1 )
145
+ . lazy ( )
146
+ . get ( )
147
+
148
+ const matches2 = regex2 . exec ( ',,,,,' )
149
+ assert . equal ( matches2 [ 0 ] , ',' )
150
+ assert . notEqual ( matches2 [ 0 ] , ',,,,,' )
151
+
110
152
} )
111
153
112
154
it ( 'Global' , ( ) => {
0 commit comments