test: migrate message eval tests from Python to JS · nodejs/node@d4404f0 · GitHub
Skip to content

Commit d4404f0

Browse files
yiyunleiaduh95
authored andcommitted
test: migrate message eval tests from Python to JS
Migrate the eval tests in the `test/message` folder from Python to JS. PR-URL: #50482 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
1 parent eaefd90 commit d4404f0

7 files changed

Lines changed: 201 additions & 168 deletions

File tree

Lines changed: 1 addition & 1 deletion
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
[eval]
2+
[eval]:1
3+
with(this){__filename}
4+
^^^^
5+
6+
SyntaxError: Strict mode code may not include a with statement
7+
8+
9+
10+
11+
12+
13+
14+
Node.js *
15+
42
16+
42
17+
[eval]:1
18+
throw new Error("hello")
19+
^
20+
21+
Error: hello
22+
23+
24+
25+
26+
27+
28+
29+
30+
Node.js *
31+
[eval]:1
32+
throw new Error("hello")
33+
^
34+
35+
Error: hello
36+
37+
38+
39+
40+
41+
42+
43+
44+
Node.js *
45+
100
46+
[eval]:1
47+
var x = 100; y = x;
48+
^
49+
50+
ReferenceError: y is not defined
51+
52+
53+
54+
55+
56+
57+
58+
59+
Node.js *
60+
61+
[eval]:1
62+
var ______________________________________________; throw 10
63+
^
64+
10
65+
(Use `node --trace-uncaught ...` to show where the exception was thrown)
66+
67+
Node.js *
68+
69+
[eval]:1
70+
var ______________________________________________; throw 10
71+
^
72+
10
73+
(Use `node --trace-uncaught ...` to show where the exception was thrown)
74+
75+
Node.js *
76+
done
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
'use strict';
2323

24-
require('../common');
24+
require('../../common');
2525

2626
const spawn = require('child_process').spawn;
2727

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
[stdin]
2+
[stdin]:1
3+
with(this){__filename}
4+
^^^^
5+
6+
SyntaxError: Strict mode code may not include a with statement
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
Node.js *
19+
42
20+
42
21+
[stdin]:1
22+
throw new Error("hello")
23+
^
24+
25+
Error: hello
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
Node.js *
38+
[stdin]:1
39+
throw new Error("hello")
40+
^
41+
42+
Error: hello
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
Node.js *
55+
100
56+
[stdin]:1
57+
let x = 100; y = x;
58+
^
59+
60+
ReferenceError: y is not defined
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
Node.js *
73+
74+
[stdin]:1
75+
let ______________________________________________; throw 10
76+
^
77+
10
78+
(Use `node --trace-uncaught ...` to show where the exception was thrown)
79+
80+
Node.js *
81+
82+
[stdin]:1
83+
let ______________________________________________; throw 10
84+
^
85+
10
86+
(Use `node --trace-uncaught ...` to show where the exception was thrown)
87+
88+
Node.js *
89+
done

test/message/eval_messages.out

Lines changed: 0 additions & 77 deletions
This file was deleted.

test/message/stdin_messages.out

Lines changed: 0 additions & 89 deletions
This file was deleted.
Lines changed: 34 additions & 0 deletions

0 commit comments

Comments
 (0)