Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8dfec58

Browse files
committed
JS: Update test
1 parent 47b5f34 commit 8dfec58

6 files changed

Lines changed: 17 additions & 3 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
| tst.js:6:7:6:19 | A.endsWith(B) | tst.js:6:7:6:7 | A | tst.js:6:18:6:18 | B | true |
22
| tst.js:7:7:7:22 | _.endsWith(A, B) | tst.js:7:18:7:18 | A | tst.js:7:21:7:21 | B | true |
33
| tst.js:8:7:8:22 | R.endsWith(A, B) | tst.js:8:18:8:18 | A | tst.js:8:21:8:21 | B | true |
4+
| tst.js:9:7:9:28 | strings ... h(A, B) | tst.js:9:24:9:24 | A | tst.js:9:27:9:27 | B | true |
5+
| tst.js:10:7:10:43 | strings ... h(A, B) | tst.js:10:39:10:39 | A | tst.js:10:42:10:42 | B | true |
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import * as _ from 'underscore';
22
import * as R from 'ramda';
3-
3+
let strings = goog.require('goog.string');
44

55
function test() {
66
if (A.endsWith(B)) {}
77
if (_.endsWith(A, B)) {}
88
if (R.endsWith(A, B)) {}
9+
if (strings.endsWith(A, B)) {}
10+
if (strings.caseInsensitiveEndsWith(A, B)) {}
911
}

javascript/ql/test/library-tests/StringOps/Includes/Includes.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
| tst.js:9:7:9:19 | ~A.indexOf(B) | tst.js:9:8:9:8 | A | tst.js:9:18:9:18 | B | true |
66
| tst.js:12:7:12:25 | A.indexOf(B) === -1 | tst.js:12:7:12:7 | A | tst.js:12:17:12:17 | B | false |
77
| tst.js:13:7:13:22 | A.indexOf(B) < 0 | tst.js:13:7:13:7 | A | tst.js:13:17:13:17 | B | false |
8+
| tst.js:20:7:20:28 | strings ... s(A, B) | tst.js:20:24:20:24 | A | tst.js:20:27:20:27 | B | true |
9+
| tst.js:21:7:21:43 | strings ... s(A, B) | tst.js:21:39:21:39 | A | tst.js:21:42:21:42 | B | true |

javascript/ql/test/library-tests/StringOps/Includes/tst.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as _ from 'lodash';
2-
2+
let strings = goog.require('goog.string');
33

44
function test() {
55
if (A.includes(B)) {}
@@ -16,4 +16,7 @@ function test() {
1616
if (A.indexOf(B) === 0) {}
1717
if (A.indexOf(B) !== 0) {}
1818
if (A.indexOf(B) > 0) {}
19+
20+
if (strings.contains(A, B)) {}
21+
if (strings.caseInsensitiveContains(A, B)) {}
1922
}

javascript/ql/test/library-tests/StringOps/StartsWith/StartsWith.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
| tst.js:17:9:17:38 | A.subst ... ) !== B | tst.js:17:9:17:9 | A | tst.js:17:38:17:38 | B | false |
1313
| tst.js:18:9:18:35 | A.subst ... ) === B | tst.js:18:9:18:9 | A | tst.js:18:35:18:35 | B | true |
1414
| tst.js:19:9:19:36 | A.subst ... "web/" | tst.js:19:9:19:9 | A | tst.js:19:31:19:36 | "web/" | true |
15+
| tst.js:32:9:32:32 | strings ... h(A, B) | tst.js:32:28:32:28 | A | tst.js:32:31:32:31 | B | true |
16+
| tst.js:33:9:33:47 | strings ... h(A, B) | tst.js:33:43:33:43 | A | tst.js:33:46:33:46 | B | true |

javascript/ql/test/library-tests/StringOps/StartsWith/tst.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as _ from 'lodash';
22
import * as R from 'ramda';
3-
3+
let strings = goog.require('goog.string');
44

55
function f(A, B) {
66
if (A.startsWith(B)) {}
@@ -28,4 +28,7 @@ function f(A, B) {
2828
if (A.indexOf(B, 2)) {}
2929
if (~A.indexOf(B)) {} // checks for existence, not startsWith
3030
if (A.substring(B.length) === 0) {}
31+
32+
if (strings.startsWith(A, B)) {}
33+
if (strings.caseInsensitiveStartsWith(A, B)) {}
3134
}

0 commit comments

Comments
 (0)