Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit ed70fd7

Browse files
committed
test escaped single hex char at end of filter
1 parent ecfefa7 commit ed70fd7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

test/filters/parse.test.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ test('GH-50 = in filter', function (t) {
2727
})
2828

2929
test('convert to hex code', function (t) {
30-
const str = 'foo=bar\\(abcd\\e\\fg\\h\\69\\'
30+
const str = 'foo=bar\\(abcd\\e\\fg\\h\\69\\a'
3131
const f = parse(str)
3232
t.ok(f)
3333
t.equal(f.attribute, 'foo')
34-
t.equal(f.value, 'bar(abcdefghi\\')
35-
t.equal(f.toString(), '(foo=bar\\28abcdefghi\\5c)')
34+
t.equal(f.value, 'bar(abcdefghia')
35+
t.equal(f.toString(), '(foo=bar\\28abcdefghia)')
3636
t.end()
3737
})
3838

@@ -66,6 +66,16 @@ test('\\ in filter', function (t) {
6666
t.end()
6767
})
6868

69+
test('not escaped \\ at end of filter', function (t) {
70+
const str = 'foo=bar\\'
71+
const f = parse(str)
72+
t.ok(f)
73+
t.equal(f.attribute, 'foo')
74+
t.equal(f.value, 'bar\\')
75+
t.equal(f.toString(), '(foo=bar\\5c)')
76+
t.end()
77+
})
78+
6979
test('* in equality filter', function (t) {
7080
const str = '(foo=bar\\*)'
7181
const f = parse(str)

0 commit comments

Comments
 (0)