on master help sign in
Fix node tests
commit303bb665609434f035835d4d3c3e6d8544ff7912 authormasad-frost <farismasad@gmail.com> dateWed 20 Jan 2021, 15:56 (6 years ago) parent10c16f9
4 files changed+25−22
run_tests+1−1 tests/nodejs/err.exp+7−7 tests/nodejs/global_bug.exp+5−5 tests/nodejs/run_file.exp+12−9
run_tests+1−1
@@ -1,7 +1,7 @@
11#!/usr/bin/env bash
22
33stty cols 80
4−stty row 20
4+stty rows 20
55
66tests=$(find ./tests -printf '%P\n')
77
tests/nodejs/err.exp+7−7
@@ -6,16 +6,16 @@ match_max 100000
66expect -exact "\[1G\[0J--> \[5G"
77send -- "x\r"
88expect -exact "x\r\r
9−\u001b\[0m\u001b\[31mReferenceError: x is not defined\r
10− at repl:1:1\r
11− at Script.runInContext (vm.js:130:18)\r
12− at REPLServer.defaultEval (repl.js:435:29)\r
9+\[0m\[31mReferenceError: x is not defined\r
10+ at REPL1:1:1\r
11+ at Script.runInThisContext (vm.js:120:18)\r
12+ at REPLServer.defaultEval (repl.js:442:29)\r
1313 at bound (domain.js:427:14)\r
1414 at REPLServer.runBound \[as eval\] (domain.js:440:12)\r
15− at REPLServer.onLine (repl.js:760:10)\r
16− at REPLServer.emit (events.js:315:20)\r
15+ at REPLServer.onLine (repl.js:777:10)\r
16+ at REPLServer.emit (events.js:314:20)\r
1717 at REPLServer.EventEmitter.emit (domain.js:483:12)\r
1818 at REPLServer.Interface._onLine (readline.js:329:10)\r
19− at REPLServer.Interface._line (readline.js:658:8)\u001b\[0m\u001b\[1G\u001b\[0J--> \u001b\[5G"
19+ at REPLServer.Interface._line (readline.js:658:8)\[0m\[1G\[0J--> \[5G"
2020send -- ""
2121expect eof
tests/nodejs/global_bug.exp+5−5
@@ -1,10 +1,10 @@
11#!/usr/bin/expect -f
22
33set timeout -1
4−spawn ./prybar-nodejs ./test_files/global_bug.js
4+spawn ./prybar-nodejs -i ./test_files/global_bug.js
55match_max 100000
6−expect -exact "Node v12.18.3 on linux\r
7−\u001b\[0m\u001b\[90mHint: hit control+c anytime to enter REPL.\[0m\r
8−\u001b\[33mtrue\u001b\[39m\r
9−"
6+expect -re {Node v\d+\.\d+.\d+ on linux}
7+expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
8+\[1G\[0J--> \[5G"
9+send -- ""
1010expect eof
tests/nodejs/run_file.exp+12−9
@@ -1,16 +1,19 @@
1−#!/usr/bin/expect -d
1+#!/usr/bin/expect -f
22
33set timeout -1
44spawn ./prybar-nodejs -i ./test_files/hello.js
55match_max 100000
6−expect -exact "Node v12.18.3 on linux\r
7−\u001b\[0m\u001b\[90mHint: hit control+c anytime to enter REPL.\[0m\r
6+expect -re {Node v\d+\.\d+.\d+ on linux}
7+expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
88hello\r
9−\u001b\[32m'hello'\u001b\[39m\r
10−\u001b\[1G\u001b\[0J--> \u001b\[5G"
11−send -- "a\r"
12−expect -exact "a\r\r
13−\u001b\[32m'hello'\u001b\[39m\r
14−\u001b\[1G\u001b\[0J--> \u001b\[5G"
9+\[32m'hello'\[39m\r
10+\[1G\[0J--> \[5G"
11+send -- "a"
12+expect -exact "\r
13+\[90m'hello'\[39m\[6G\[1A"
14+send -- "\r"
15+expect -exact "\[1B\[2K\[1A\r\r
16+\[32m'hello'\[39m\r
17+\[1G\[0J--> \[5G"
1518send -- ""
1619expect eof