test escaped single hex char at end of filter

This commit is contained in:
Tony Brix 2019-09-18 14:46:49 -05:00
parent ecfefa7ff0
commit ed70fd7615
1 changed files with 13 additions and 3 deletions

View File

@ -27,12 +27,12 @@ test('GH-50 = in filter', function (t) {
})
test('convert to hex code', function (t) {
const str = 'foo=bar\\(abcd\\e\\fg\\h\\69\\'
const str = 'foo=bar\\(abcd\\e\\fg\\h\\69\\a'
const f = parse(str)
t.ok(f)
t.equal(f.attribute, 'foo')
t.equal(f.value, 'bar(abcdefghi\\')
t.equal(f.toString(), '(foo=bar\\28abcdefghi\\5c)')
t.equal(f.value, 'bar(abcdefghia')
t.equal(f.toString(), '(foo=bar\\28abcdefghia)')
t.end()
})
@ -66,6 +66,16 @@ test('\\ in filter', function (t) {
t.end()
})
test('not escaped \\ at end of filter', function (t) {
const str = 'foo=bar\\'
const f = parse(str)
t.ok(f)
t.equal(f.attribute, 'foo')
t.equal(f.value, 'bar\\')
t.equal(f.toString(), '(foo=bar\\5c)')
t.end()
})
test('* in equality filter', function (t) {
const str = '(foo=bar\\*)'
const f = parse(str)