diff --git a/lib/test.js b/lib/test.js index bfd1bb14..4744d75f 100644 --- a/lib/test.js +++ b/lib/test.js @@ -207,7 +207,7 @@ Test.prototype._assert = function assert (ok, opts) { if (!ok) { var e = new Error('exception'); var err = (e.stack || '').split('\n'); - var dir = path.dirname(__dirname) + '/'; + var dir = path.dirname(__dirname) + path.sep; for (var i = 0; i < err.length; i++) { var m = /^[^\s]*\s*\bat\s+(.+)/.exec(err[i]); @@ -216,12 +216,12 @@ Test.prototype._assert = function assert (ok, opts) { } var s = m[1].split(/\s+/); - var filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]); + var filem = /((?:\/|\w:\\)[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[1]); if (!filem) { - filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[2]); + filem = /((?:\/|\w:\\)[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[2]); if (!filem) { - filem = /(\/[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]); + filem = /((?:\/|\w:\\)[^:\s]+:(\d+)(?::(\d+))?)/.exec(s[3]); if (!filem) { continue;