From c4e9226bdb5ce00fbe8a8b2dcb4ac4ebfe5de119 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sat, 7 Jul 2012 15:01:51 -0700 Subject: [PATCH] Fix test-require-json on Windows --- test/simple/test-require-json.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/simple/test-require-json.js b/test/simple/test-require-json.js index 027cae6798..59b1e3d61f 100644 --- a/test/simple/test-require-json.js +++ b/test/simple/test-require-json.js @@ -24,6 +24,7 @@ var assert = require('assert'); try { require('../fixtures/invalid.json'); } catch (err) { - var i = err.message.indexOf('test/fixtures/invalid.json: Unexpected string') - assert(-1 != i, 'require() json error should include path'); -} \ No newline at end of file + var re = /test[\/\\]fixtures[\/\\]invalid.json: Unexpected string/; + var i = err.message.match(re); + assert(null !== i, 'require() json error should include path'); +}