Add NodeJS tests.
commite049ef9f771ac2112d274b639895ae73dc0839c3
authorRob Blanckaert <basicer@basicer.com>
dateWed 7 Nov 2018, 18:03 (8 years ago)
parente8e8b23
Dockerfile+2−1
@@ -11,7 +11,8 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
1111 tcl-dev \
1212 libnspr4-dev \
1313 libffi-dev \
14− expect
14+ expect \
15+ nodejs
1516
1617RUN wget \
1718 http://launchpadlibrarian.net/309343864/libmozjs185-dev_1.8.5-1.0.0+dfsg-7_amd64.deb && \
run_tests+1−1
@@ -20,5 +20,5 @@ for t in ${tests}; do
2020 fi
2121
2222 echo -ne '\r'
23− echo " ✓ $name"
23+ echo -e " \e[32m✓\e[0m $name"
2424done
tests/nodejs/1_plus_1.expnew file+12
@@ -0,0 +1,12 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i -q
5+match_max 100000
6+expect -exact "\[1G\[0J--> \[5G"
7+send -- "1+1\r"
8+expect -exact "1+1\r\r
9+\[33m2\[39m\r
10+\[1G\[0J--> \[5G"
11+send -- ""
12+expect eof
tests/nodejs/set_ps1.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i -q -ps1 custom
5+match_max 100000
6+expect -exact "\[1G\[0Jcustom\[7G"
7+send -- "console.log('hit')"
8+expect -exact "console.log('hit')"
9+send -- "\r"
10+send -- ""
11+expect eof
tests/python3/show_header.exp+3−3
@@ -3,9 +3,9 @@
33set timeout -1
44spawn ./prybar-python3 -i
55match_max 100000
6−expect -exact "Python 3.6.6 (default, Sep 12 2018, 18:26:19) \r
7−\[GCC 8.0.1 20180414 (experimental) \[trunk revision 259383\]\] on linux\r
8−--> "
6+expect -re {Python 3\.\d+\.\d+ ([^)]+)}
7+expect -re {\[.+\] on [a-z0-9]+\r\n}
8+expect -exact "--> "
99send -- "1+1\r"
1010expect -exact "1+1\r
11112\r