Skip to content

Commit 26c5ea9

Browse files
committed
Update CTS
1 parent 8e235f6 commit 26c5ea9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

tests/path/regex_filters.test.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,26 @@ describe("match filter", () => {
5656
});
5757
test("explicit end dollar", () => {
5858
const env = new JSONPathEnvironment();
59-
const query = "$[?match(@, '.*?bc$')]";
59+
const query = "$[?match(@, '.bc$')]";
6060
const data = ["abcd", "abc", "axc"];
6161
const rv = env.query(query, data);
6262
expect(rv.values()).toStrictEqual(["abc"]);
6363
});
64+
// test("handle escaped left square bracket", () => {
65+
// const env = new JSONPathEnvironment();
66+
// const query = "$[?match(@, 'ab\\\\[.d')]";
67+
// const data = ["abcd", "ab.d", "ab[d"];
68+
// const rv = env.query(query, data);
69+
// expect(rv.values()).toStrictEqual(["ab[d"]);
70+
// });
71+
72+
// test("handle escaped backslash before dot", () => {
73+
// const env = new JSONPathEnvironment();
74+
// const query = "$[?match(@, 'ab\\\\\\\\.d')]";
75+
// const data = ["abcd", "ab.d", "ab\\d"];
76+
// const rv = env.query(query, data);
77+
// expect(rv.values()).toStrictEqual(["ab\\d"]);
78+
// });
6479
});
6580

6681
describe("search filter", () => {

0 commit comments

Comments
 (0)