Permalink
Browse files

failing test for booleans

  • Loading branch information...
1 parent 463e594 commit ac75ce530070c224960d57f204117b1e7cf33732 @substack committed Jun 8, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/boolean.js
View
@@ -0,0 +1,20 @@
+var pathway = require('../');
+var test = require('tap').test;
+
+test('boolean elements in paths', function (t) {
+ var xs = [
+ { x : { y : { z : 555 } } },
+ { beep : 'boop' },
+ { x : { y : { z : 444 } }, w : 4 },
+ { x : { y : 'zzz' } },
+ { x : { y : { z : 333 } } },
+ { X : { y : { z : 222 } } }
+ ];
+ var ys = pathway(xs, [ true, /x/i, 'y', 'z' ]);
+ t.same(ys, [ 555, 444, 333, 222 ]);
+
+ var empty = pathway(xs, [ true, /x/i, false, 'z' ]);
+ t.same(empty, []);
+
+ t.end();
+});

0 comments on commit ac75ce5

Please sign in to comment.