on master help sign in
more tests
commit431724bec69b64c63fd983777e8a9476fefb71c5 authorAmjad Masad <amjad.masad@gmail.com> dateSat 29 Aug 2020, 21:35 (6 years ago) parent296f026
3 files changed+28
test_files/hello.js+3 tests/nodejs/header.exp+9 tests/nodejs/run_file.exp+16
test_files/hello.jsnew file+3
@@ -0,0 +1,3 @@
1+let a = "hello";
2+console.log(a);
3+a;
tests/nodejs/header.expnew file+9
@@ -0,0 +1,9 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i
5+match_max 100000
6+expect -re {Node v\d+\.\d+.\d+ on linux}
7+expect -exact "\[1G\[0J--> \[5G"
8+send -- ""
9+expect eof
tests/nodejs/run_file.expnew file+16
@@ -0,0 +1,16 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i ./test_files/hello.js
5+match_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+hello\r
9+hello\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"
15+send -- ""
16+expect eof