#!/usr/bin/env node

var inquiry = require("../..");
require("proof")(4, function (equal) {
  var object;
  object = { firstName: "Abraham", lastName: "Lincoln" };
  equal(inquiry("{$.firstName == 'Abraham'}")(object).pop().lastName, 'Lincoln', 'rooted');
  object = require('./presidents');
  equal(inquiry("/presidents{$.firstName == 'Abraham'}")(object).pop().lastName, 'Lincoln', 'array');
  equal(inquiry("/presidents/.{$.firstName == 'Abraham'}")(object).pop().lastName, 'Lincoln', 'array as self');
  equal(inquiry("/presidents/.{$.firstName == 'Abraham'}/lastName")(object).pop(), 'Lincoln', 'array as self');
});

@@ -67,9 +67,9 @@
 f%22)(
-4
+5
 , fu
@@ -97,16 +97,24 @@
 r object
+, result
 ;%0A  obje
@@ -291,30 +291,33 @@
 idents');%0A  
-equal(
+result = 
 inquiry(%22/pr
@@ -352,32 +352,91 @@
 aham'%7D%22)(object)
+;%0A  equal(result.length, 1, 'array length');%0A  equal(result
 .pop().lastName,
@@ -453,16 +453,20 @@
 , 'array
+ pop
 ');%0A  eq

Break up the array test to see what's going on.