if (phantom.args.length != 1) {
  console.log('Expected a target URL parameter.');
  phantom.exit(1);
}

var page = require('webpage').create();
var url = phantom.args[0];

page.onConsoleMessage = function (message) {
  console.log("Test console: " + message);
};

console.log("Loading URL: " + url);

page.open(url, function (status) {
  if (status != "success") {
    console.log('Failed to open ' + url);
    setTimeout(function() { // https://github.com/ariya/phantomjs/issues/12697
      phantom.exit(1);
    }, 0);
  }

  console.log("Running test.");

  var result = page.evaluate(function() {
    return testdouble.cljs.csv_test.run();
  });

  var failures = result.arr[1];
  if (failures !== 0) {
    console.log("*** Test failed! ***");
    setTimeout(function() { // https://github.com/ariya/phantomjs/issues/12697
      phantom.exit(1);
    }, 0);
  }

  var errors = result.arr[3];
  if (errors !== 0) {
    console.log("*** Test errored! ***");
    setTimeout(function() { // https://github.com/ariya/phantomjs/issues/12697
      phantom.exit(1);
    }, 0);
  }

  console.log("Test succeeded.");
  setTimeout(function() { // https://github.com/ariya/phantomjs/issues/12697
    phantom.exit(0);
  }, 0);
});

@@ -1,14 +1,86 @@
-if (phanto
+var page = require('webpage').create();%0Avar system = require('system');%0A%0Aif (syste
 m.ar
@@ -95,10 +95,11 @@
 h !=
- 1
+= 2
 ) %7B%0A
@@ -175,76 +175,8 @@
 %0A%7D%0A%0A
-var page = require('webpage').create();%0Avar url = phantom.args%5B0%5D;%0A%0A
 page
@@ -263,16 +263,42 @@
 e);%0A%7D;%0A%0A
+var url = system.args%5B1%5D;%0A
 console.

upgrade phantomjs runner