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) {
55
55
}
56
56
57
57
function search ( x ) {
58
- return x . search ( / [ a - z ] * / ) ; // NOT OK
58
+ return x . search ( / [ a - z ] * / ) > - 1 ; // NOT OK
59
59
}
60
60
61
61
function search2 ( x ) {
62
- return x . search ( / [ a - z ] / ) ; // OK
62
+ return x . search ( / [ a - z ] / ) > - 1 ; // OK
63
63
}
64
64
65
65
function lookahead ( x ) {
66
- return x . search ( / (? ! x ) / ) ; // OK
66
+ return x . search ( / (? ! x ) / ) > - 1 ; // OK
67
67
}
68
68
69
69
function 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
71
71
}
72
72
73
73
function 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
75
75
}
76
76
77
77
function wordBoundary ( x ) {
You can’t perform that action at this time.
0 commit comments