From c637b6f59a623a32720865da7fae2d4bcc67b2a5 Mon Sep 17 00:00:00 2001 From: Asger F Date: Fri, 26 May 2023 14:10:26 +0200 Subject: [PATCH] JS: Update test for RegExpAlwaysMatches --- .../test/query-tests/RegExp/RegExpAlwaysMatches/tst.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches/tst.js b/javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches/tst.js index a266e2d86f6..b4c54be9b8a 100644 --- a/javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches/tst.js +++ b/javascript/ql/test/query-tests/RegExp/RegExpAlwaysMatches/tst.js @@ -55,23 +55,23 @@ function emptyAlt3(x) { } function search(x) { - return x.search(/[a-z]*/); // NOT OK + return x.search(/[a-z]*/) > -1; // NOT OK } function search2(x) { - return x.search(/[a-z]/); // OK + return x.search(/[a-z]/) > -1; // OK } function lookahead(x) { - return x.search(/(?!x)/); // OK + return x.search(/(?!x)/) > -1; // OK } function searchPrefix(x) { - return x.search(/^(foo)?/); // NOT OK - `foo?` does not affect the returned index + return x.search(/^(foo)?/) > -1; // NOT OK - `foo?` does not affect the returned index } function searchSuffix(x) { - return x.search(/(foo)?$/); // OK - `foo?` affects the returned index + return x.search(/(foo)?$/) > -1; // OK - `foo?` affects the returned index } function wordBoundary(x) {