File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -55,23 +55,23 @@ function emptyAlt3(x) {
5555}
5656
5757function search ( x ) {
58- return x . search ( / [ a - z ] * / ) ; // NOT OK
58+ return x . search ( / [ a - z ] * / ) > - 1 ; // NOT OK
5959}
6060
6161function search2 ( x ) {
62- return x . search ( / [ a - z ] / ) ; // OK
62+ return x . search ( / [ a - z ] / ) > - 1 ; // OK
6363}
6464
6565function lookahead ( x ) {
66- return x . search ( / (? ! x ) / ) ; // OK
66+ return x . search ( / (? ! x ) / ) > - 1 ; // OK
6767}
6868
6969function searchPrefix ( x ) {
70- return x . search ( / ^ ( f o o ) ? / ) ; // NOT OK - `foo?` does not affect the returned index
70+ return x . search ( / ^ ( f o o ) ? / ) > - 1 ; // NOT OK - `foo?` does not affect the returned index
7171}
7272
7373function searchSuffix ( x ) {
74- return x . search ( / ( f o o ) ? $ / ) ; // OK - `foo?` affects the returned index
74+ return x . search ( / ( f o o ) ? $ / ) > - 1 ; // OK - `foo?` affects the returned index
7575}
7676
7777function wordBoundary ( x ) {
You can’t perform that action at this time.
0 commit comments