diff --git a/bin/ldapjs-search b/bin/ldapjs-search index 66853bd..bfd854c 100755 --- a/bin/ldapjs-search +++ b/bin/ldapjs-search @@ -95,7 +95,6 @@ function perror(err) { ///--- Mainline -log4js.setGlobalLogLevel('INFO'); var parsed; try { diff --git a/lib/filters/index.js b/lib/filters/index.js index 476396f..62782f5 100644 --- a/lib/filters/index.js +++ b/lib/filters/index.js @@ -130,7 +130,8 @@ function _buildFilterTree(expr) { operatorStr = '='; tree.tag = 'equalityMatch'; } else { - tree.tag = 'present'; + // tree.tag = 'present'; + throw new Error('invalid filter syntax'); } if (operatorStr === '') { diff --git a/test/filters/parse.test.js b/test/filters/parse.test.js index 6e7ab8c..6302cc0 100644 --- a/test/filters/parse.test.js +++ b/test/filters/parse.test.js @@ -116,10 +116,17 @@ test('GH-53 NotFilter', function (t) { test('presence filter', function (t) { - var str = '(foo=*)'; - var f = parse(str); + var f = parse('(foo=*)'); t.ok(f); t.equal(f.type, 'present'); t.equal(f.attribute, 'foo'); t.end(); }); + + +test('bogus filter', function (t) { + t.throws(function () { + parse('foo>1'); + }); + t.end(); +});