Browse files

Add test for partial corrupt stack

  • Loading branch information...
1 parent f605924 commit fb88b4aeecc74f716059f3701b47a597ebbe76ef @felixge committed Jul 20, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/integration/test-parse.js
View
14 test/integration/test-parse.js
@@ -19,6 +19,20 @@ var stackTrace = require(common.dir.lib + '/stack-trace');
})();
})();
+
+(function testCorruptStack() {
+ var err = {};
+ err.stack =
+'AssertionError: true == false\n' +
+' fuck' +
+' at Test.run (/Users/felix/code/node-fast-or-slow/lib/test.js:45:10)\n' +
+'oh no' +
+' at TestCase.run (/Users/felix/code/node-fast-or-slow/lib/test_case.js:61:8)\n';
+
+ var trace = stackTrace.parse(err);
+ assert.equal(trace.length, 2);
+})();
+
(function testCompareRealWithParsedStackTrace() {
var realTrace = stackTrace.get(); var err = new Error('something went wrong');
var parsedTrace = stackTrace.parse(err);

0 comments on commit fb88b4a

Please sign in to comment.