Permalink
Browse files

added some not() tests, failing

  • Loading branch information...
1 parent bb35047 commit c48cd9d4d456049282bb1744cf82bb92a0804b27 @dvv dvv committed Nov 30, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/js-array.js
View
@@ -47,6 +47,14 @@ exports.testFiltering1 = function() {
assert.deepEqual(executeQuery("not(any(path.1,7))&sort()", {}, data), [data[0]]); // 7 found in second
};
+exports.testNot = function() {
+ var data = [{"path.1":[1,2,3]}, {"path.1":[9,3,7]}];
+ assert.deepEqual(executeQuery("not(not(any(path,3)))", {}, data), []); // path is undefined
+ assert.deepEqual(executeQuery("not(not(any(path.1,3)))", {}, data), data); // 3 found in both
+ assert.deepEqual(executeQuery("not(not(any(path.1,7)))", {}, data), [data[1]]); // 7 found in second
+ assert.deepEqual(executeQuery("not(not(not(any(path.1,7))))", {}, data), [data[0]]); // 7 found in second
+};
+
if (require.main === module)
require("patr/runner").run(exports);

0 comments on commit c48cd9d

Please sign in to comment.