on master help sign in
gosh those expect tests are brittle
commit8c6fa14712424ba3c909cd2b6a7004cd847ddb93 authorMason Clayton <masongclayton@gmail.com> dateTue 5 Mar 2019, 21:34 (8 years ago) parent230ce95
7 files changed+117−170
tests/lua/own_eval.exp−51 tests/tcl/1_plus_1.exp+11−11 tests/tcl/a_few_outputs.exp+44−40 tests/tcl/from_file.exp+15−15 tests/tcl/input_output.exp+38−38 tests/tcl/status_line.exp−6 tests/tcl/unknown_command.exp+9−9
tests/lua/own_eval.expdeleted−51
@@ -1,51 +0,0 @@
1−#!/usr/bin/expect -f
2−
3−set timeout -1
4−spawn ./prybar-lua -I
5−match_max 100000
6−expect -exact "Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio\r
7−--> "
8−send -- "1"
9−expect -exact "\r--> 1\[0K\r\[5C"
10−send -- "+"
11−expect -exact "\r--> 1+\[0K\r\[6C"
12−send -- "1"
13−expect -exact "\r--> 1+1\[0K\r\[7C"
14−send -- "\r"
15−expect -exact "\r--> 1+1\[0K\r\[7C\r
16−lua: \[string \"<eval>\"\]:1: unexpected symbol near '1'\r
17−--> "
18−send -- "r"
19−expect -exact "\r--> r\[0K\r\[5C"
20−send -- "e"
21−expect -exact "\r--> re\[0K\r\[6C"
22−send -- "t"
23−expect -exact "\r--> ret\[0K\r\[7C"
24−send -- "u"
25−expect -exact "\r--> retu\[0K\r\[8C"
26−send -- "r"
27−expect -exact "\r--> retur\[0K\r\[9C"
28−send -- "n"
29−expect -exact "\r--> return\[0K\r\[10C"
30−send -- " "
31−expect -exact "\r--> return \[0K\r\[11C"
32−send -- "1"
33−expect -exact "\r--> return 1\[0K\r\[12C"
34−send -- "\r"
35−expect -exact "\r--> return 1\[0K\r\[12C\r
36−--> "
37−send -- "a"
38−expect -exact "\r--> a\[0K\r\[5C"
39−send -- " "
40−expect -exact "\r--> a \[0K\r\[6C"
41−send -- ""
42−expect -exact "\r--> a\[0K\r\[5C"
43−send -- "="
44−expect -exact "\r--> a=\[0K\r\[6C"
45−send -- "1"
46−expect -exact "\r--> a=1\[0K\r\[7C"
47−send -- "\r"
48−expect -exact "\r--> a=1\[0K\r\[7C\r
49−--> "
50−send -- ""
51−expect eof
tests/tcl/1_plus_1.exp+11−11
@@ -3,26 +3,26 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "--> "
6+expect -exact "\[J\[2K\r--> "
77send -- "e"
8−expect -exact "\r--> e\[0K\r\[5C"
8+expect -exact "\[J\[2K\r--> e"
99send -- "x"
10−expect -exact "\r--> ex\[0K\r\[6C"
10+expect -exact "\[J\[2K\r--> ex"
1111send -- "p"
12−expect -exact "\r--> exp\[0K\r\[7C"
12+expect -exact "\[J\[2K\r--> exp"
1313send -- "r"
14−expect -exact "\r--> expr\[0K\r\[8C"
14+expect -exact "\[J\[2K\r--> expr"
1515send -- " "
16−expect -exact "\r--> expr \[0K\r\[9C"
16+expect -exact "\[J\[2K\r--> expr "
1717send -- "1"
18−expect -exact "\r--> expr 1\[0K\r\[10C"
18+expect -exact "\[J\[2K\r--> expr 1"
1919send -- "+"
20−expect -exact "\r--> expr 1+\[0K\r\[11C"
20+expect -exact "\[J\[2K\r--> expr 1+"
2121send -- "1"
22−expect -exact "\r--> expr 1+1\[0K\r\[12C"
22+expect -exact "\[J\[2K\r--> expr 1+1"
2323send -- "\r"
24−expect -exact "\r--> expr 1+1\[0K\r\[12C\r
24+expect -exact "\[J\[2K\r--> expr 1+1\[J\[2K\r--> expr 1+1\r
25252\r
26−--> "
26+\[J\[2K\r--> "
2727send -- ""
2828expect eof
tests/tcl/a_few_outputs.exp+44−40
@@ -3,87 +3,91 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "--> "
6+expect -exact "\[J\[2K\r--> "
77send -- "p"
8−expect -exact "\r--> p\[0K\r\[5C"
8+expect -exact "\[J\[2K\r--> p"
99send -- "u"
10−expect -exact "\r--> pu\[0K\r\[6C"
10+expect -exact "\[J\[2K\r--> pu"
1111send -- "t"
12−expect -exact "\r--> put\[0K\r\[7C"
12+expect -exact "\[J\[2K\r--> put"
1313send -- "s"
14−expect -exact "\r--> puts\[0K\r\[8C"
14+expect -exact "\[J\[2K\r--> puts"
1515send -- " "
16−expect -exact "\r--> puts \[0K\r\[9C"
16+expect -exact "\[J\[2K\r--> puts "
1717send -- "\""
18−expect -exact "\r--> puts \"\[0K\r\[10C"
18+expect -exact "\[J\[2K\r--> puts \""
1919send -- "h"
20−expect -exact "\r--> puts \"h\[0K\r\[11C"
20+expect -exact "\[J\[2K\r--> puts \"h"
2121send -- "e"
22−expect -exact "\r--> puts \"he\[0K\r\[12C"
22+expect -exact "\[J\[2K\r--> puts \"he"
2323send -- "y"
24−expect -exact "\r--> puts \"hey\[0K\r\[13C"
24+expect -exact "\[J\[2K\r--> puts \"hey"
2525send -- "\""
26−expect -exact "\r--> puts \"hey\"\[0K\r\[14C"
26+expect -exact "\[J\[2K\r--> puts \"hey\""
2727send -- "\r"
28−expect -exact "\r--> puts \"hey\"\[0K\r\[14C\r
28+expect -exact "\[J\[2K\r--> puts \"hey\"\[J\[2K\r--> puts \"hey\"\r
2929hey\r\r
3030\r
31−--> "
31+\[J\[2K\r--> "
3232send -- "p"
33−expect -exact "\r--> p\[0K\r\[5C"
33+expect -exact "\[J\[2K\r--> p"
3434send -- "u"
35−expect -exact "\r--> pu\[0K\r\[6C"
35+expect -exact "\[J\[2K\r--> pu"
3636send -- "t"
37−expect -exact "\r--> put\[0K\r\[7C"
37+expect -exact "\[J\[2K\r--> put"
3838send -- "s"
39−expect -exact "\r--> puts\[0K\r\[8C"
39+expect -exact "\[J\[2K\r--> puts"
4040send -- " "
41−expect -exact "\r--> puts \[0K\r\[9C"
41+expect -exact "\[J\[2K\r--> puts "
4242send -- "\""
43−expect -exact "\r--> puts \"\[0K\r\[10C"
43+expect -exact "\[J\[2K\r--> puts \""
4444send -- "h"
45−expect -exact "\r--> puts \"h\[0K\r\[11C"
45+expect -exact "\[J\[2K\r--> puts \"h"
4646send -- "e"
47−expect -exact "\r--> puts \"he\[0K\r\[12C"
47+expect -exact "\[J\[2K\r--> puts \"he"
4848send -- "y"
49−expect -exact "\r--> puts \"hey\[0K\r\[13C"
49+expect -exact "\[J\[2K\r--> puts \"hey"
5050send -- "\""
51−expect -exact "\r--> puts \"hey\"\[0K\r\[14C"
51+expect -exact "\[J\[2K\r--> puts \"hey\""
5252send -- "\r"
53−expect -exact "\r--> puts \"hey\"\[0K\r\[14C\r
53+expect -exact "\[J\[2K\r--> puts \"hey\"\[J\[2K\r--> puts \"hey\"\r
5454hey\r\r
5555\r
56−--> "
56+\[J\[2K\r--> "
5757send -- "p"
58−expect -exact "\r--> p\[0K\r\[5C"
58+expect -exact "\[J\[2K\r--> p"
5959send -- "u"
60−expect -exact "\r--> pu\[0K\r\[6C"
60+expect -exact "\[J\[2K\r--> pu"
6161send -- "t"
62−expect -exact "\r--> put\[0K\r\[7C"
62+expect -exact "\[J\[2K\r--> put"
6363send -- "s"
64−expect -exact "\r--> puts\[0K\r\[8C"
64+expect -exact "\[J\[2K\r--> puts"
6565send -- " "
66−expect -exact "\r--> puts \[0K\r\[9C"
66+expect -exact "\[J\[2K\r--> puts "
67+send -- "\""
68+expect -exact "\[J\[2K\r--> puts \""
6769send -- "h"
68−expect -exact "\r--> puts h\[0K\r\[10C"
70+expect -exact "\[J\[2K\r--> puts \"h"
6971send -- "e"
70−expect -exact "\r--> puts he\[0K\r\[11C"
72+expect -exact "\[J\[2K\r--> puts \"he"
7173send -- "e"
72−expect -exact "\r--> puts hee\[0K\r\[12C"
74+expect -exact "\[J\[2K\r--> puts \"hee"
7375send -- "e"
74−expect -exact "\r--> puts heee\[0K\r\[13C"
76+expect -exact "\[J\[2K\r--> puts \"heee"
7577send -- "e"
76−expect -exact "\r--> puts heeee\[0K\r\[14C"
78+expect -exact "\[J\[2K\r--> puts \"heeee"
7779send -- "e"
78−expect -exact "\r--> puts heeeee\[0K\r\[15C"
80+expect -exact "\[J\[2K\r--> puts \"heeeee"
7981send -- "e"
80−expect -exact "\r--> puts heeeeee\[0K\r\[16C"
82+expect -exact "\[J\[2K\r--> puts \"heeeeee"
8183send -- "y"
82−expect -exact "\r--> puts heeeeeey\[0K\r\[17C"
84+expect -exact "\[J\[2K\r--> puts \"heeeeeey"
85+send -- "\""
86+expect -exact "\[J\[2K\r--> puts \"heeeeeey\""
8387send -- "\r"
84−expect -exact "\r--> puts heeeeeey\[0K\r\[17C\r
88+expect -exact "\[J\[2K\r--> puts \"heeeeeey\"\[J\[2K\r--> puts \"heeeeeey\"\r
8589heeeeeey\r\r
8690\r
87−--> "
91+\[J\[2K\r--> "
8892send -- ""
8993expect eof
tests/tcl/from_file.exp+15−15
@@ -4,35 +4,35 @@ set timeout -1
44spawn ./prybar-tcl -q -i ./test_files/hello_tcl.tcl
55match_max 100000
66expect -exact "Hello, Tcl!\r\r
7−--> "
7+\[J\[2K\r--> "
88send -- "p"
9−expect -exact "\r--> p\[0K\r\[5C"
9+expect -exact "\[J\[2K\r--> p"
1010send -- "u"
11−expect -exact "\r--> pu\[0K\r\[6C"
11+expect -exact "\[J\[2K\r--> pu"
1212send -- "t"
13−expect -exact "\r--> put\[0K\r\[7C"
13+expect -exact "\[J\[2K\r--> put"
1414send -- "s"
15−expect -exact "\r--> puts\[0K\r\[8C"
15+expect -exact "\[J\[2K\r--> puts"
1616send -- " "
17−expect -exact "\r--> puts \[0K\r\[9C"
17+expect -exact "\[J\[2K\r--> puts "
1818send -- "\$"
19−expect -exact "\r--> puts \$\[0K\r\[10C"
19+expect -exact "\[J\[2K\r--> puts \$"
2020send -- "m"
21−expect -exact "\r--> puts \$m\[0K\r\[11C"
21+expect -exact "\[J\[2K\r--> puts \$m"
2222send -- "y"
23−expect -exact "\r--> puts \$my\[0K\r\[12C"
23+expect -exact "\[J\[2K\r--> puts \$my"
2424send -- "_"
25−expect -exact "\r--> puts \$my_\[0K\r\[13C"
25+expect -exact "\[J\[2K\r--> puts \$my_"
2626send -- "n"
27−expect -exact "\r--> puts \$my_n\[0K\r\[14C"
27+expect -exact "\[J\[2K\r--> puts \$my_n"
2828send -- "u"
29−expect -exact "\r--> puts \$my_nu\[0K\r\[15C"
29+expect -exact "\[J\[2K\r--> puts \$my_nu"
3030send -- "m"
31−expect -exact "\r--> puts \$my_num\[0K\r\[16C"
31+expect -exact "\[J\[2K\r--> puts \$my_num"
3232send -- "\r"
33−expect -exact "\r--> puts \$my_num\[0K\r\[16C\r
33+expect -exact "\[J\[2K\r--> puts \$my_num\[J\[2K\r--> puts \$my_num\r
34341000\r\r
3535\r
36−--> "
36+\[J\[2K\r--> "
3737send -- ""
3838expect eof
tests/tcl/input_output.exp+38−38
@@ -3,76 +3,76 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "--> "
6+expect -exact "\[J\[2K\r--> "
77send -- "s"
8−expect -exact "\r--> s\[0K\r\[5C"
8+expect -exact "\[J\[2K\r--> s"
99send -- "e"
10−expect -exact "\r--> se\[0K\r\[6C"
10+expect -exact "\[J\[2K\r--> se"
1111send -- "t"
12−expect -exact "\r--> set\[0K\r\[7C"
12+expect -exact "\[J\[2K\r--> set"
1313send -- " "
14−expect -exact "\r--> set \[0K\r\[8C"
14+expect -exact "\[J\[2K\r--> set "
1515send -- "i"
16−expect -exact "\r--> set i\[0K\r\[9C"
16+expect -exact "\[J\[2K\r--> set i"
1717send -- "n"
18−expect -exact "\r--> set in\[0K\r\[10C"
18+expect -exact "\[J\[2K\r--> set in"
1919send -- "p"
20−expect -exact "\r--> set inp\[0K\r\[11C"
20+expect -exact "\[J\[2K\r--> set inp"
2121send -- " "
22−expect -exact "\r--> set inp \[0K\r\[12C"
22+expect -exact "\[J\[2K\r--> set inp "
2323send -- "\["
24−expect -exact "\r--> set inp \[\[0K\r\[13C"
24+expect -exact "\[J\[2K\r--> set inp \["
2525send -- "g"
26−expect -exact "\r--> set inp \[g\[0K\r\[14C"
26+expect -exact "\[J\[2K\r--> set inp \[g"
2727send -- "e"
28−expect -exact "\r--> set inp \[ge\[0K\r\[15C"
28+expect -exact "\[J\[2K\r--> set inp \[ge"
2929send -- "t"
30−expect -exact "\r--> set inp \[get\[0K\r\[16C"
30+expect -exact "\[J\[2K\r--> set inp \[get"
3131send -- "s"
32−expect -exact "\r--> set inp \[gets\[0K\r\[17C"
32+expect -exact "\[J\[2K\r--> set inp \[gets"
3333send -- " "
34−expect -exact "\r--> set inp \[gets \[0K\r\[18C"
34+expect -exact "\[J\[2K\r--> set inp \[gets "
3535send -- "s"
36−expect -exact "\r--> set inp \[gets s\[0K\r\[19C"
36+expect -exact "\[J\[2K\r--> set inp \[gets s"
3737send -- "t"
38−expect -exact "\r--> set inp \[gets st\[0K\r\[20C"
38+expect -exact "\[J\[2K\r--> set inp \[gets st"
3939send -- "d"
40−expect -exact "\r--> set inp \[gets std\[0K\r\[21C"
40+expect -exact "\[J\[2K\r--> set inp \[gets std"
4141send -- "i"
42−expect -exact "\r--> set inp \[gets stdi\[0K\r\[22C"
42+expect -exact "\[J\[2K\r--> set inp \[gets stdi"
4343send -- "n"
44−expect -exact "\r--> set inp \[gets stdin\[0K\r\[23C"
44+expect -exact "\[J\[2K\r--> set inp \[gets stdin"
4545send -- "\]"
46−expect -exact "\r--> set inp \[gets stdin\]\[0K\r\[24C"
46+expect -exact "\[J\[2K\r--> set inp \[gets stdin\]"
4747send -- "\r"
48−expect -exact "\r--> set inp \[gets stdin\]\[0K\r\[24C\r
48+expect -exact "\[J\[2K\r--> set inp \[gets stdin\]\[J\[2K\r--> set inp \[gets stdin\]\r
4949"
50−send -- "hellooooooo\r"
51−expect -exact "hellooooooo\r
52−hellooooooo\r
53−--> "
50+send -- "helloooooo\r"
51+expect -exact "helloooooo\r
52+helloooooo\r
53+\[J\[2K\r--> "
5454send -- "p"
55−expect -exact "\r--> p\[0K\r\[5C"
55+expect -exact "\[J\[2K\r--> p"
5656send -- "u"
57−expect -exact "\r--> pu\[0K\r\[6C"
57+expect -exact "\[J\[2K\r--> pu"
5858send -- "t"
59−expect -exact "\r--> put\[0K\r\[7C"
59+expect -exact "\[J\[2K\r--> put"
6060send -- "s"
61−expect -exact "\r--> puts\[0K\r\[8C"
61+expect -exact "\[J\[2K\r--> puts"
6262send -- " "
63−expect -exact "\r--> puts \[0K\r\[9C"
63+expect -exact "\[J\[2K\r--> puts "
6464send -- "\$"
65−expect -exact "\r--> puts \$\[0K\r\[10C"
65+expect -exact "\[J\[2K\r--> puts \$"
6666send -- "i"
67−expect -exact "\r--> puts \$i\[0K\r\[11C"
67+expect -exact "\[J\[2K\r--> puts \$i"
6868send -- "n"
69−expect -exact "\r--> puts \$in\[0K\r\[12C"
69+expect -exact "\[J\[2K\r--> puts \$in"
7070send -- "p"
71−expect -exact "\r--> puts \$inp\[0K\r\[13C"
71+expect -exact "\[J\[2K\r--> puts \$inp"
7272send -- "\r"
73−expect -exact "\r--> puts \$inp\[0K\r\[13C\r
74−hellooooooo\r\r
73+expect -exact "\[J\[2K\r--> puts \$inp\[J\[2K\r--> puts \$inp\r
74+helloooooo\r\r
7575\r
76−--> "
76+\[J\[2K\r--> "
7777send -- ""
7878expect eof
tests/tcl/status_line.expdeleted−6
@@ -1,6 +0,0 @@
1−#!/usr/bin/expect -f
2−
3−set timeout -1
4−spawn ./prybar-tcl
5−match_max 100000
6−expect eof
tests/tcl/unknown_command.exp+9−9
@@ -3,23 +3,23 @@
33set timeout -1
44spawn ./prybar-tcl -q -i
55match_max 100000
6−expect -exact "--> "
6+expect -exact "\[J\[2K\r--> "
77send -- "h"
8−expect -exact "\r--> h\[0K\r\[5C"
8+expect -exact "\[J\[2K\r--> h"
99send -- "m"
10−expect -exact "\r--> hm\[0K\r\[6C"
10+expect -exact "\[J\[2K\r--> hm"
1111send -- "m"
12−expect -exact "\r--> hmm\[0K\r\[7C"
12+expect -exact "\[J\[2K\r--> hmm"
1313send -- "m"
14−expect -exact "\r--> hmmm\[0K\r\[8C"
14+expect -exact "\[J\[2K\r--> hmmm"
1515send -- "m"
16−expect -exact "\r--> hmmmm\[0K\r\[9C"
16+expect -exact "\[J\[2K\r--> hmmmm"
1717send -- "m"
18−expect -exact "\r--> hmmmmm\[0K\r\[10C"
18+expect -exact "\[J\[2K\r--> hmmmmm"
1919send -- "\r"
20−expect -exact "\r--> hmmmmm\[0K\r\[10C\r
20+expect -exact "\[J\[2K\r--> hmmmmm\[J\[2K\r--> hmmmmm\r
2121error: invalid command name \"hmmmmm\"\r
2222\r
23−--> "
23+\[J\[2K\r--> "
2424send -- ""
2525expect eof