Skip to content
Browse files

test-message: fix message output

1. The net changes add a stack frame to stdin errors.
2. The error line numbers were overly strict in many places.
  • Loading branch information...
1 parent ddb02b9 commit 99ad0561c04a8b255f6049f494fe15cb56e0b382 @isaacs committed Aug 5, 2012
Showing with 62 additions and 45 deletions.
  1. +20 −20 test/message/eval_messages.out
  2. +28 −24 test/message/stdin_messages.out
  3. +14 −1 test/message/testcfg.py
View
40 test/message/eval_messages.out
@@ -4,11 +4,11 @@
with(this){__filename}
^^^^
SyntaxError: Strict mode code may not include a with statement
- at Object.<anonymous> ([eval]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at startup (node.js:76:7)
- at node.js:623:3
+ at Object.<anonymous> ([eval]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at startup (node.js:*:*)
+ at node.js:*:*
42
42
@@ -17,34 +17,34 @@ throw new Error("hello")
^
Error: hello
at [eval]:1:7
- at Object.<anonymous> ([eval]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at startup (node.js:76:7)
- at node.js:623:3
+ at Object.<anonymous> ([eval]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at startup (node.js:*:*)
+ at node.js:*:*
[eval]:1
throw new Error("hello")
^
Error: hello
at [eval]:1:7
- at Object.<anonymous> ([eval]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at startup (node.js:76:7)
- at node.js:623:3
+ at Object.<anonymous> ([eval]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at startup (node.js:*:*)
+ at node.js:*:*
100
[eval]:1
var x = 100; y = x;
^
ReferenceError: y is not defined
at [eval]:1:16
- at Object.<anonymous> ([eval]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at startup (node.js:76:7)
- at node.js:623:3
+ at Object.<anonymous> ([eval]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at startup (node.js:*:*)
+ at node.js:*:*
[eval]:1
var ______________________________________________; throw 10
View
52 test/message/stdin_messages.out
@@ -4,12 +4,13 @@
with(this){__filename}
^^^^
SyntaxError: Strict mode code may not include a with statement
- at Object.<anonymous> ([stdin]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at Socket.<anonymous> (node.js:152:11)
- at Socket.EventEmitter.emit (events.js:85:17)
- at Pipe.onread (net.js:424:51)
+ at Object.<anonymous> ([stdin]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at Socket.<anonymous> (node.js:*:*)
+ at Socket.EventEmitter.emit (events.js:*:*)
+ at Pipe.onread (net.js:*:*)
+ at process.startup.processMakeCallback.process._makeCallback (node.js:*:*)
42
42
@@ -18,37 +19,40 @@ throw new Error("hello")
^
Error: hello
at [stdin]:1:7
- at Object.<anonymous> ([stdin]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at Socket.<anonymous> (node.js:152:11)
- at Socket.EventEmitter.emit (events.js:85:17)
- at Pipe.onread (net.js:424:51)
+ at Object.<anonymous> ([stdin]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at Socket.<anonymous> (node.js:*:*)
+ at Socket.EventEmitter.emit (events.js:*:*)
+ at Pipe.onread (net.js:*:*)
+ at process.startup.processMakeCallback.process._makeCallback (node.js:*:*)
[stdin]:1
throw new Error("hello")
^
Error: hello
at [stdin]:1:7
- at Object.<anonymous> ([stdin]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at Socket.<anonymous> (node.js:152:11)
- at Socket.EventEmitter.emit (events.js:85:17)
- at Pipe.onread (net.js:424:51)
+ at Object.<anonymous> ([stdin]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at Socket.<anonymous> (node.js:*:*)
+ at Socket.EventEmitter.emit (events.js:*:*)
+ at Pipe.onread (net.js:*:*)
+ at process.startup.processMakeCallback.process._makeCallback (node.js:*:*)
100
[stdin]:1
var x = 100; y = x;
^
ReferenceError: y is not defined
at [stdin]:1:16
- at Object.<anonymous> ([stdin]-wrapper:6:22)
- at Module._compile (module.js:449:26)
- at evalScript (node.js:282:25)
- at Socket.<anonymous> (node.js:152:11)
- at Socket.EventEmitter.emit (events.js:85:17)
- at Pipe.onread (net.js:424:51)
+ at Object.<anonymous> ([stdin]-wrapper:*:*)
+ at Module._compile (module.js:*:*)
+ at evalScript (node.js:*:*)
+ at Socket.<anonymous> (node.js:*:*)
+ at Socket.EventEmitter.emit (events.js:*:*)
+ at Pipe.onread (net.js:*:*)
+ at process.startup.processMakeCallback.process._makeCallback (node.js:*:*)
[stdin]:1
var ______________________________________________; throw 10
View
15 test/message/testcfg.py
@@ -43,7 +43,7 @@ def __init__(self, path, file, expected, mode, context, config):
def IgnoreLine(self, str):
"""Ignore empty lines and valgrind output."""
- if not str: return True
+ if not str.strip(): return True
else: return str.startswith('==') or str.startswith('**')
def IsFailureOutput(self, output):
@@ -66,9 +66,22 @@ def IsFailureOutput(self, output):
raw_lines = (output.stdout + output.stderr).split('\n')
outlines = [ s for s in raw_lines if not self.IgnoreLine(s) ]
if len(outlines) != len(patterns):
+ print "length differs."
+ print "expect=%d" % len(patterns)
+ print "actual=%d" % len(outlines)
+ print "patterns:"
+ for i in xrange(len(patterns)):
+ print "pattern = %s" % patterns[i]
+ print "outlines:"
+ for i in xrange(len(outlines)):
+ print "outline = %s" % outlines[i]
return True
for i in xrange(len(patterns)):
if not re.match(patterns[i], outlines[i]):
+ print "match failed"
+ print "line=%d" % i
+ print "expect=%s" % patterns[i]
+ print "actual=%s" % outlines[i]
return True
return False

0 comments on commit 99ad056

Please sign in to comment.
Something went wrong with that request. Please try again.