Browse Source

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.
v0.9.1-release
isaacs 13 years ago
parent
commit
99ad0561c0
  1. 40
      test/message/eval_messages.out
  2. 52
      test/message/stdin_messages.out
  3. 15
      test/message/testcfg.py

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,22 +17,22 @@ 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
@ -40,11 +40,11 @@ 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

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,24 +19,26 @@ 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
@ -43,12 +46,13 @@ 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

15
test/message/testcfg.py

@ -43,7 +43,7 @@ class MessageTestCase(test.TestCase):
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 @@ class MessageTestCase(test.TestCase):
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

Loading…
Cancel
Save