Duplicate teh test files to keep CI working
commit1fae78b5c35c252ba9db6d8d7961f39f97088a39
authorguillaume <guillaume@repl.it>
dateWed 23 Jun 2021, 16:50 (5 years ago)
parent340845d
nix_tests/clojure/all.expnew file+39
@@ -0,0 +1,39 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -c {(defn f [x] (inc x))} -e {(def s "bar")} -I -i -q ./test_files/hello.clj
8+match_max 100000
9+expect -re "^${_}hello${_}\r
10+${_}#'user/s${_}\r
11+${_}--> $"
12+
13+# a is defined in ./test_files/hello.clj
14+send -- "a\r"
15+expect -re "^${_}a${_}\r
16+${_}\"hello\"${_}\r
17+${_}--> $"
18+
19+# b is defined in ./test_files/hello.clj
20+send -- "b\r"
21+expect -re "^${_}b${_}\r
22+${_}42${_}\r
23+${_}--> $"
24+
25+# defined with "-c"
26+send -- "(f b)\r"
27+expect -re "^${_}(f b)${_}\r
28+${_}43${_}\r
29+${_}--> $"
30+
31+# defined with "-e"
32+send -- "s\r"
33+expect -re "^${_}s${_}\r
34+${_}\"bar\"${_}\r
35+${_}--> $"
36+
37+send -- ""
38+expect eof
39+
nix_tests/clojure/evaluate_expression.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -e {(str (+ 1 1))}
8+match_max 100000
9+expect -re "^${_}\"2\"${_}$"
10+expect eof
11+
nix_tests/clojure/initialize_code_with_script.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -c {(do (print (str a " " b)) "return-value")} ./test_files/hello.clj
8+match_max 100000
9+expect -re "^${_}hello 42${_}$"
10+expect eof
11+
nix_tests/clojure/initialize_expression_with_script.expnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -e "(str (inc b))" ./test_files/hello.clj
8+match_max 100000
9+expect -re "^${_}\"43\"${_}\r$"
10+
nix_tests/clojure/initialize_repl_with_script.expnew file+21
@@ -0,0 +1,21 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -i ./test_files/hello.clj
8+match_max 100000
9+expect -re "^${_}hello${_}\r
10+${_}Clojure${_}\r
11+${_}--> $"
12+
13+# b is defined in ./test_files/hello.clj
14+send -- "b\r"
15+expect -re "^${_}b${_}\r
16+${_}42${_}\r
17+${_}--> $"
18+
19+send -- ""
20+expect eof
21+
nix_tests/clojure/plus_1_1.expnew file+19
@@ -0,0 +1,19 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -i
8+match_max 100000
9+expect -re "^${_}Clojure${_}\r
10+${_}--> $"
11+
12+send -- "(str (+ 1 1))\r"
13+expect -re "${_}\\(str \\(\\+ 1 1\\)\\)${_}\r
14+${_}2${_}\r
15+${_}--> $"
16+
17+send -- ""
18+expect eof
19+
nix_tests/clojure/print.expnew file+24
@@ -0,0 +1,24 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+set timeout -1
7+spawn ./prybar-clojure -i
8+match_max 100000
9+expect -re "^${_}Clojure${_}\r
10+${_}--> $"
11+
12+send -- "(print \"hello!\")\r"
13+expect -re "^${_}\\(print \"hello!\"\\)${_}\r
14+${_}hello!nil${_}\r
15+${_}--> $"
16+
17+send -- "(print (+ 1 1))\r"
18+expect -re "^${_}\\(print \\(\\+ 1 1\\)\\)${_}\r
19+${_}2nil${_}\r
20+${_}--> $"
21+
22+send -- ""
23+expect eof
24+
nix_tests/clojure/quiet_repl.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+# ignore ANSI escape sequences
4+set _ "(?:.*?)"
5+
6+spawn ./prybar-clojure -i -q
7+expect -re "^${_}--> $"
8+
9+send -- ""
10+expect eof
11+
nix_tests/clojure/run_code.expnew file+7
@@ -0,0 +1,7 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-clojure -q -c {(do (println "foo") "bar")}
5+match_max 100000
6+expect -re "^\r\r\u001b\\\[K\rfoo\r\r\n$"
7+
nix_tests/clojure/run_script.expnew file+5
@@ -0,0 +1,5 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-clojure ./test_files/hello.clj
4+expect eof
5+
nix_tests/julia/1_plus_1.expnew file+13
@@ -0,0 +1,13 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-julia -q -i
5+match_max 100000
6+expect -exact "\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
7+send -- "1+1\r"
8+expect -exact "1+1\r\[0K\[1m--> \[0m\[0m\r\[4C1+1\r\[7C\r
9+\[?2004l\[0m\[0m2\r
10+\r
11+\r\[0K\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
12+send -- ""
13+expect eof
nix_tests/julia/header.expnew file+60
@@ -0,0 +1,60 @@
1+#!/usr/bin/expect -f
2+#
3+# This Expect script was generated by autoexpect on Fri Jun 12 21:00:42 2020
4+# Expect and autoexpect were both written by Don Libes, NIST.
5+#
6+# Note that autoexpect does not guarantee a working script. It
7+# necessarily has to guess about certain things. Two reasons a script
8+# might fail are:
9+#
10+# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
11+# etc.) and devices discard or ignore keystrokes that arrive "too
12+# quickly" after prompts. If you find your new script hanging up at
13+# one spot, try adding a short sleep just before the previous send.
14+# Setting "force_conservative" to 1 (see below) makes Expect do this
15+# automatically - pausing briefly before sending each character. This
16+# pacifies every program I know of. The -c flag makes the script do
17+# this in the first place. The -C flag allows you to define a
18+# character to toggle this mode off and on.
19+
20+set force_conservative 0 ;# set to 1 to force conservative mode even if
21+ ;# script wasn't run conservatively originally
22+if {$force_conservative} {
23+ set send_slow {1 .1}
24+ proc send {ignore arg} {
25+ sleep .1
26+ exp_send -s -- $arg
27+ }
28+}
29+
30+#
31+# 2) differing output - Some programs produce different output each time
32+# they run. The "date" command is an obvious example. Another is
33+# ftp, if it produces throughput statistics at the end of a file
34+# transfer. If this causes a problem, delete these patterns or replace
35+# them with wildcards. An alternative is to use the -p flag (for
36+# "prompt") which makes Expect only look for the last line of output
37+# (i.e., the prompt). The -P flag allows you to define a character to
38+# toggle this mode off and on.
39+#
40+# Read the man page for more info.
41+#
42+# -Don
43+
44+
45+set timeout -1
46+spawn ./prybar-julia -i
47+match_max 100000
48+expect -exact " \[1m\[32m_\[0m\r
49+ \[1m\[34m_\[0m \[0m_\[0m \[1m\[31m_\[1m\[32m(_)\[1m\[35m_\[0m | Documentation: https://docs.julialang.org\r
50+ \[1m\[34m(_)\[0m | \[1m\[31m(_)\[0m \[1m\[35m(_)\[0m |\r
51+ \[0m_ _ _| |_ __ _\[0m | Type \"?\" for help, \"\]?\" for Pkg help.\r
52+ \[0m| | | | | | |/ _` |\[0m |\r
53+ \[0m| | |_| | | | (_| |\[0m | Version 1.5.4 (2021-03-11)\r
54+ \[0m_/ |\\__'_|_|_|\\__'_|\[0m | Official https://julialang.org/ release\r
55+\[0m|__/\[0m |\r
56+\r
57+\r
58+\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
59+send -- ""
60+expect eof
nix_tests/julia/input.expnew file+31
@@ -0,0 +1,31 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-julia -q -i
5+match_max 100000
6+expect -exact "\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
7+send -- "n = readline()\r"
8+expect -exact "n = readline()\r\[0K\[1m--> \[0m\[0m\r\[4Cn = readline()\r\[18C\r
9+\[?2004l\[0m"
10+send -- "hello\r"
11+expect -exact "hello\r
12+\[0m\"hello\"\r
13+\r
14+\r\[0K\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
15+send -- "println(hello"
16+expect -exact "\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(hell\r\[16C"
17+send -- ""
18+expect -exact "\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(hel\r\[15C"
19+send -- ""
20+expect -exact "\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(he\r\[14C"
21+send -- ""
22+expect -exact "\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(h\r\[13C"
23+send -- ""
24+expect -exact "\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(\r\[12C"
25+send -- "n)\r"
26+expect -exact "n)\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(n)\r\[14C\r
27+\[?2004l\[0mhello\r
28+\r
29+\r\[0K\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
30+send -- ""
31+expect eof
nix_tests/julia/print_a_line.expnew file+15
@@ -0,0 +1,15 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-julia -q -i
5+match_max 100000
6+expect -exact "\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
7+send -- "println()"
8+expect -exact "\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(\r\[12C"
9+send -- "\"hellooooooo\")\r"
10+expect -exact "\"hellooooooo\")\r\[0K\[1m--> \[0m\[0m\r\[4Cprintln(\"hellooooooo\")\r\[26C\r
11+\[?2004l\[0mhellooooooo\r
12+\r
13+\r\[0K\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
14+send -- ""
15+expect eof
nix_tests/julia/start_with_file.expnew file+14
@@ -0,0 +1,14 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-julia -q -i ./test_files/hi_julia.jl
5+match_max 100000
6+expect -exact "hey from julia\r
7+\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
8+send -- "my_number\r"
9+expect -exact "my_number\r\[0K\[1m--> \[0m\[0m\r\[4Cmy_number\r\[13C\r
10+\[?2004l\[0m\[0m500\r
11+\r
12+\r\[0K\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C\[?2004h\r\[0K\[1m--> \[0m\[0m\r\[4C\r\[4C"
13+send -- ""
14+expect eof
nix_tests/lua/always_try_expression.expnew file+26
@@ -0,0 +1,26 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-lua -q -i
5+match_max 100000
6+expect -exact "--> "
7+send -- "function a() return 123 end\r"
8+expect -exact "function a() return 123 end\r
9+--> "
10+send -- "a()\r"
11+expect -exact "a()\r
12+123\r
13+--> "
14+send -- "return a()\r"
15+expect -exact "return a()\r
16+123\r
17+--> "
18+send -- "a(\r"
19+expect -exact "a(\r
20+... "
21+send -- ")\r"
22+expect -exact ")\r
23+123\r
24+--> "
25+send -- ""
26+expect eof
nix_tests/lua/history.expnew file+30
@@ -0,0 +1,30 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-lua -q -i
5+match_max 100000
6+expect -exact "--> "
7+send -- "1\r"
8+expect -exact "1\r
9+1\r
10+--> "
11+send -- "2\r"
12+expect -exact "2\r
13+2\r
14+--> "
15+send -- "3\r"
16+expect -exact "3\r
17+3\r
18+--> "
19+send -- "\[A"
20+expect -exact "3"
21+send -- "\[A"
22+expect -exact "2"
23+send -- "\[A"
24+expect -exact "1"
25+send -- "\r"
26+expect -exact "\r
27+1\r
28+--> "
29+send -- ""
30+expect eof
nix_tests/lua/load_file.expnew file+14
@@ -0,0 +1,14 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-lua -i ./test_files/hello.lua
5+match_max 100000
6+expect -exact "Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio\r
7+hi!\r
8+--> "
9+send -- "a\r"
10+expect -exact "a\r
11+hello\r
12+--> "
13+send -- ""
14+expect eof
nix_tests/lua/ps1_ps2.expnew file+18
@@ -0,0 +1,18 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-lua -i -ps1 ps1 -ps2 ps2
5+match_max 100000
6+expect -exact "Lua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-Rio\r
7+ps1"
8+send -- "a(\r"
9+expect -exact "a(\r
10+ps2"
11+send -- ")\r"
12+expect -exact ")\r
13+stdin:1: attempt to call global 'a' (a nil value)\r
14+stack traceback:\r
15+ stdin:1: in main chunk\r
16+ps1"
17+send -- ""
18+expect eof
nix_tests/lua/quiet.expnew file+12
@@ -0,0 +1,12 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-lua -q -i
5+match_max 100000
6+expect -exact "--> "
7+send -- "1+1\r"
8+expect -exact "1+1\r
9+2\r
10+--> "
11+send -- ""
12+expect eof
nix_tests/lua/returns.expnew file+19
@@ -0,0 +1,19 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-lua -q -i
5+match_max 100000
6+expect -exact "--> "
7+send -- "123\r"
8+expect -exact "123\r
9+123\r
10+--> "
11+send -- "function a() print(1) end\r"
12+expect -exact "function a() print(1) end\r
13+--> "
14+send -- "a()\r"
15+expect -exact "a()\r
16+1\r
17+--> "
18+send -- ""
19+expect eof
nix_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
nix_tests/nodejs/err.expnew file+21
@@ -0,0 +1,21 @@
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 -- "x\r"
8+expect -exact "x\r\r
9+\[0m\[31mReferenceError: x is not defined\r
10+ at REPL1:1:1\r
11+ at Script.runInThisContext (vm.js:133:18)\r
12+ at REPLServer.defaultEval (repl.js:486:29)\r
13+ at bound (domain.js:416:15)\r
14+ at REPLServer.runBound \[as eval\] (domain.js:427:12)\r
15+ at REPLServer.onLine (repl.js:819:10)\r
16+ at REPLServer.emit (events.js:376:20)\r
17+ at REPLServer.emit (domain.js:470:12)\r
18+ at REPLServer.Interface._onLine (readline.js:342:10)\r
19+ at REPLServer.Interface._line (readline.js:671:8)\[0m\[1G\[0J--> \[5G"
20+send -- ""
21+expect eof
nix_tests/nodejs/eval_code.expnew file+8
@@ -0,0 +1,8 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -q -e 1+1
5+match_max 100000
6+expect -exact "\u001b\[33m2\u001b\[39m\r
7+"
8+expect eof
nix_tests/nodejs/global_bug.expnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i ./test_files/global_bug.js
5+match_max 100000
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 -- ""
10+expect eof
nix_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
nix_tests/nodejs/module_patching.expnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -i ./test_files/global_bug.js
5+match_max 100000
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 -- ""
10+expect eof
nix_tests/nodejs/printing.expnew file+13
@@ -0,0 +1,13 @@
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 -- "console.log('x')\r"
8+expect -exact "console.log('x')\r\r
9+x\r
10+\[90mundefined\[39m\r
11+\[1G\[0J--> "
12+send -- ""
13+expect eof
nix_tests/nodejs/run_code.expnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-nodejs -q -c 1+1
5+match_max 100000
6+expect eof
nix_tests/nodejs/run_file.expnew file+19
@@ -0,0 +1,19 @@
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 -re {Node v\d+\.\d+.\d+ on linux}
7+expect -exact "\[0m\[90mHint: hit control+c anytime to enter REPL.\[0m\r
8+hello\r
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"
18+send -- ""
19+expect eof
nix_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
nix_tests/ocaml/code_print.expnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -q -c "print_endline(\"hello world\")"
4+match_max 100000
5+expect -exact "hello world"
6+expect eof
nix_tests/ocaml/exception.expnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -q -i
4+match_max 100000
5+expect -exact "--> "
6+send -- "raise (Invalid_argument \"doh\");;\r"
7+expect -exact "Exception: Invalid_argument \"doh\".\r
8+--> "
9+send -- ""
10+expect eof
nix_tests/ocaml/expr.expnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -q -e 1+1
4+match_max 100000
5+expect -exact "- : int = 2"
6+expect eof
nix_tests/ocaml/not_quiet.expnew file+9
@@ -0,0 +1,9 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -e 1+1
4+match_max 100000
5+
6+# OCaml 4.06.0 on Unix
7+expect -re "^OCaml (.*) on Unix"
8+expect -exact "- : int = 2"
9+expect eof
nix_tests/ocaml/ps1.expnew file+9
@@ -0,0 +1,9 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -q -i -ps1 ">>"
4+match_max 100000
5+expect -exact ">>"
6+send -- "1+1;;\r"
7+expect -exact "- : int = 2"
8+send -- ""
9+expect eof
nix_tests/ocaml/ps2.expnew file+14
@@ -0,0 +1,14 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -q -i -ps2 continuation
4+match_max 100000
5+expect -exact "--> "
6+send -- "let a =\r"
7+expect -exact "let a =\r
8+continuation"
9+send -- "print_endline(\"continued!\");;\r"
10+expect -exact "continued!\r
11+val a : unit = ()\r
12+-->"
13+send -- ""
14+expect eof
nix_tests/ocaml/quiet.expnew file+10
@@ -0,0 +1,10 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-ocaml -q -i
4+match_max 100000
5+expect -exact "--> "
6+send -- "1+1;;\r"
7+expect -exact "- : int = 2\r
8+--> "
9+send -- ""
10+expect eof
nix_tests/python2/1_plus_1.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -i
4+match_max 100000
5+expect -exact "--> "
6+send -- "1+1\r"
7+expect -exact "1+1\r
8+2\r
9+--> "
10+send -- ""
11+expect eof
nix_tests/python2/code_print.expnew file+5
@@ -0,0 +1,5 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -q -c print('hello')
4+match_max 100000
5+expect eof
nix_tests/python2/exception.expnew file+13
@@ -0,0 +1,13 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -q -i
4+match_max 100000
5+expect -exact "--> "
6+send -- "ohno\r"
7+expect -exact "ohno\r
8+Traceback (most recent call last):\r
9+ File \"<stdin>\", line 1, in <module>\r
10+NameError: name 'ohno' is not defined\r
11+--> "
12+send -- ""
13+expect eof
nix_tests/python2/expr.expnew file+5
@@ -0,0 +1,5 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -e 1+1
4+match_max 100000
5+expect eof
nix_tests/python2/ps1.expnew file+12
@@ -0,0 +1,12 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -i -ps1 somethingelse
4+match_max 100000
5+expect "Python 2.*\r"
6+expect -exact "somethingelse"
7+send -- "123\r"
8+expect -exact "123\r
9+123\r
10+somethingelse"
11+send -- ""
12+expect eof
nix_tests/python2/ps2.expnew file+18
@@ -0,0 +1,18 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -i -ps2 continuation
4+match_max 100000
5+expect "Python 2.*\r"
6+expect -exact "--> "
7+send -- "if True:\r"
8+expect -exact "if True:\r
9+continuation"
10+send -- " print('continued!')\r"
11+expect -exact "continued!')\r
12+continuation"
13+send -- ""
14+expect -exact "\r
15+continued!\r
16+--> "
17+send -- ""
18+expect eof
nix_tests/python2/quiet.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -q -i
4+match_max 100000
5+expect -exact "--> "
6+send -- "1+1\r"
7+expect -exact "1+1\r
8+2\r
9+--> "
10+send -- ""
11+expect eof
nix_tests/python2/stdout_stderr.expnew file+222
@@ -0,0 +1,222 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-python2 -q -i
4+match_max 100000
5+expect -exact "--> "
6+send -- "import sys\r"
7+expect -exact "import sys\r
8+--> "
9+send -- "for i in range(0, 100):\r"
10+expect -exact "in range(0, 100):\r
11+... "
12+send -- " sys.stderr.write(str(i) + '\\n')\r"
13+expect -exact " sys.stderr.write(str(i) + '\\n')\r
14+... "
15+send -- " sys.stdout.write(str(i) + '\\n')\r"
16+expect -exact " sys.stdout.write(str(i) + '\\n')\r
17+... "
18+send -- "\r"
19+expect -exact "\r
20+0\r
21+0\r
22+1\r
23+1\r
24+2\r
25+2\r
26+3\r
27+3\r
28+4\r
29+4\r
30+5\r
31+5\r
32+6\r
33+6\r
34+7\r
35+7\r
36+8\r
37+8\r
38+9\r
39+9\r
40+10\r
41+10\r
42+11\r
43+11\r
44+12\r
45+12\r
46+13\r
47+13\r
48+14\r
49+14\r
50+15\r
51+15\r
52+16\r
53+16\r
54+17\r
55+17\r
56+18\r
57+18\r
58+19\r
59+19\r
60+20\r
61+20\r
62+21\r
63+21\r
64+22\r
65+22\r
66+23\r
67+23\r
68+24\r
69+24\r
70+25\r
71+25\r
72+26\r
73+26\r
74+27\r
75+27\r
76+28\r
77+28\r
78+29\r
79+29\r
80+30\r
81+30\r
82+31\r
83+31\r
84+32\r
85+32\r
86+33\r
87+33\r
88+34\r
89+34\r
90+35\r
91+35\r
92+36\r
93+36\r
94+37\r
95+37\r
96+38\r
97+38\r
98+39\r
99+39\r
100+40\r
101+40\r
102+41\r
103+41\r
104+42\r
105+42\r
106+43\r
107+43\r
108+44\r
109+44\r
110+45\r
111+45\r
112+46\r
113+46\r
114+47\r
115+47\r
116+48\r
117+48\r
118+49\r
119+49\r
120+50\r
121+50\r
122+51\r
123+51\r
124+52\r
125+52\r
126+53\r
127+53\r
128+54\r
129+54\r
130+55\r
131+55\r
132+56\r
133+56\r
134+57\r
135+57\r
136+58\r
137+58\r
138+59\r
139+59\r
140+60\r
141+60\r
142+61\r
143+61\r
144+62\r
145+62\r
146+63\r
147+63\r
148+64\r
149+64\r
150+65\r
151+65\r
152+66\r
153+66\r
154+67\r
155+67\r
156+68\r
157+68\r
158+69\r
159+69\r
160+70\r
161+70\r
162+71\r
163+71\r
164+72\r
165+72\r
166+73\r
167+73\r
168+74\r
169+74\r
170+75\r
171+75\r
172+76\r
173+76\r
174+77\r
175+77\r
176+78\r
177+78\r
178+79\r
179+79\r
180+80\r
181+80\r
182+81\r
183+81\r
184+82\r
185+82\r
186+83\r
187+83\r
188+84\r
189+84\r
190+85\r
191+85\r
192+86\r
193+86\r
194+87\r
195+87\r
196+88\r
197+88\r
198+89\r
199+89\r
200+90\r
201+90\r
202+91\r
203+91\r
204+92\r
205+92\r
206+93\r
207+93\r
208+94\r
209+94\r
210+95\r
211+95\r
212+96\r
213+96\r
214+97\r
215+97\r
216+98\r
217+98\r
218+99\r
219+99\r
220+--> "
221+send -- ""
222+expect eof
nix_tests/python3/1_plus_1.expnew file+12
@@ -0,0 +1,12 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -i -q
5+match_max 100000
6+expect -exact "--> "
7+send -- "1+1\r"
8+expect -exact "1+1\r
9+2\r
10+--> "
11+send -- ""
12+expect eof
nix_tests/python3/eval_code.expnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -e 1+1
5+match_max 100000
6+expect eof
nix_tests/python3/printing.expnew file+16
@@ -0,0 +1,16 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -i -q
5+match_max 100000
6+expect -exact "--> "
7+send -- "print('hello!')\r"
8+expect -exact "'hello!')\r
9+hello!\r
10+--> "
11+send -- "print(1+1)\r"
12+expect -exact "print(1+1)\r
13+2\r
14+--> "
15+send -- ""
16+expect eof
nix_tests/python3/run_code.expnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -c print('hello')
5+match_max 100000
6+expect eof
nix_tests/python3/set_ps1.expnew file+12
@@ -0,0 +1,12 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -i -q -ps1 custom
5+match_max 100000
6+expect -exact "custom"
7+send -- "print('hit')\r"
8+expect -exact "print('hit')\r
9+hit\r
10+custom"
11+send -- ""
12+expect eof
nix_tests/python3/set_ps2.expnew file+17
@@ -0,0 +1,17 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -i -q -ps2 custom
5+match_max 100000
6+expect -exact "--> "
7+send -- "while False:\r"
8+expect -exact "while False:\r
9+custom"
10+send -- " pass\r"
11+expect -exact " pass\r
12+custom"
13+send -- "\r"
14+expect -exact "\r
15+--> "
16+send -- ""
17+expect eof
nix_tests/python3/show_header.expnew file+14
@@ -0,0 +1,14 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-python3 -i
5+match_max 100000
6+expect -re {Python 3\.\d+\.\d+ ([^)]+)}
7+expect -re {\[.+\] on [a-z0-9]+\r\n}
8+expect -exact "--> "
9+send -- "1+1\r"
10+expect -exact "1+1\r
11+2\r
12+--> "
13+send -- ""
14+expect eof
nix_tests/python3/stderr_red.expnew file+51
@@ -0,0 +1,51 @@
1+#!/usr/bin/expect -f
2+
3+# red is currently nondeterministic
4+exit 0
5+
6+spawn ./prybar-python3 -i -q -R
7+match_max 100000
8+expect -exact "--> "
9+send -- "import sys\r"
10+expect -exact "import sys\r
11+--> "
12+send -- "sys.stderr.write()\[D"
13+expect -exact ""
14+send -- "'"
15+expect -exact "')"
16+send -- "'"
17+expect -exact "')"
18+send -- "\[D"
19+expect -exact ""
20+send -- "w"
21+expect -exact "w')"
22+send -- "e"
23+expect -exact "e')"
24+send -- "e"
25+expect -exact "e')"
26+send -- "e"
27+expect -exact "e')"
28+send -- "e"
29+expect -exact "e')"
30+send -- "e"
31+expect -exact "e')"
32+send -- "e"
33+expect -exact "e')"
34+send -- "e"
35+expect -exact "e')"
36+send -- "e"
37+expect -exact "e')"
38+send -- "e"
39+expect -exact "e')"
40+send -- "e"
41+expect -exact "e')"
42+send -- "e"
43+expect -exact "e')"
44+send -- "e"
45+expect -exact "e')"
46+send -- "\\"
47+expect -exact "\\')"
48+send -- "n"
49+expect -exact "n')"
50+send -- "\r"
51+expect eof
nix_tests/sqlite/1_plus_1.expnew file+7
@@ -0,0 +1,7 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-sqlite -q -i
4+expect -- "^--> "
5+send "select 1+1;\r"
6+expect -exact "2"
7+expect -exact "--> "
nix_tests/sqlite/eval.expnew file+5
@@ -0,0 +1,5 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-sqlite -e "select 1+1;"
4+expect ^2
5+expect eof
nix_tests/sqlite/exec.expnew file+4
@@ -0,0 +1,4 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-sqlite -c "select 1+1;"
4+expect ^eof
nix_tests/sqlite/header.expnew file+4
@@ -0,0 +1,4 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-sqlite -i
4+expect -gl "-- Loading resources from /tmp/sqlite-config*\r\nSQLite version 3.27.2*\r\nEnter \".help\" for usage hints.\r\n--> "
nix_tests/sqlite/quiet.expnew file+6
@@ -0,0 +1,6 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-sqlite -q -i
4+expect "^--> "
5+send ".quit \r"
6+expect eof
nix_tests/sqlite/read_file.expnew file+5
@@ -0,0 +1,5 @@
1+#!/usr/bin/expect -f
2+
3+spawn ./prybar-sqlite -q -i ./test_files/hello.sql
4+expect -- "^hey there\r
5+--> "
nix_tests/tcl/1_plus_1.exp_skipnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i
5+match_max 100000
6+expect -exact "\[J\[2K\r--> "
7+send -- "expr 1+1\r"
8+expect -exact "2\r
9+\[J\[2K\r--> "
10+send -- ""
11+expect eof
nix_tests/tcl/a_few_outputs.expnew file+20
@@ -0,0 +1,20 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i
5+match_max 100000
6+
7+send "puts \"hey\"\r"
8+expect -exact "puts \"hey\"\r"
9+expect -exact "hey\r"
10+expect -exact "--> "
11+
12+send "puts \"hey\"\r"
13+expect -exact "puts \"hey\"\r"
14+expect -exact "hey\r"
15+expect -exact "--> "
16+
17+send "puts \"hello\"\r"
18+expect -exact "puts \"hello\"\r"
19+expect -exact "hello\r"
20+expect -exact "--> "
nix_tests/tcl/from_file.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i ./test_files/hello_tcl.tcl
5+match_max 100000
6+
7+expect -exact "Hello, Tcl!\r"
8+
9+send "puts \$my_num\r"
10+expect -exact "--> puts \$my_num\r"
11+expect -exact "1000\r"
nix_tests/tcl/input_output.expnew file+15
@@ -0,0 +1,15 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i
5+match_max 100000
6+expect -exact "--> "
7+send "set inp \[gets stdin\]\r"
8+expect -exact "--> set inp \[gets stdin\]\r"
9+send "hey\r"
10+expect -exact "hey\r"
11+expect -exact "--> "
12+send "puts \$inp\r"
13+expect -exact "--> puts \$inp\r"
14+expect -exact "hey\r"
15+expect -exact "--> "
nix_tests/tcl/invalid_command.expnew file+7
@@ -0,0 +1,7 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i ./test-files/hi_julia.jl
5+match_max 100000
6+
7+expect -exact "error: invalid command name \"my_number\"\r"
nix_tests/tcl/unknown_command.expnew file+9
@@ -0,0 +1,9 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i
5+match_max 100000
6+send "hmm\r"
7+expect -exact "hmm\r"
8+expect -exact "error: invalid command name \"hmm\"\r"
9+expect -exact "--> "
run_tests_language+2−2
@@ -4,7 +4,7 @@ stty cols 80
44stty rows 20
55
66language=$1
7−tests=$(find "./tests/${language}" -printf '%P\n')
7+tests=$(find "./nix_tests/${language}" -printf '%P\n')
88
99for t in ${tests}; do
1010 if [[ $t != *.exp ]]; then
@@ -16,7 +16,7 @@ for t in ${tests}; do
1616
1717 echo -n "... ${language} $name"
1818
19− test_out=$(timeout 15 "./tests/${language}/$t" 2>&1)
19+ test_out=$(timeout 15 "./nix_tests/${language}/$t" 2>&1)
2020 if [[ $? != 0 ]]; then
2121 echo -e "\n========== \"$t\" failed =========="
2222 echo "$test_out"
tests/clojure/run_code.exp+2−1
@@ -1,7 +1,8 @@
11#!/usr/bin/expect -f
22
33set timeout -1
4−spawn ./prybar-clojure -q -c {(do (println "foo") "bar")}
4+spawn ./prybar-clojure -c {(do (println "foo") "bar")}
55match_max 100000
66expect -re "^\r\r\u001b\\\[K\rfoo\r\r\n$"
7+expect eof
78
tests/julia/header.exp+2−2
@@ -43,14 +43,14 @@ if {$force_conservative} {
4343
4444
4545set timeout -1
46−spawn ./prybar-julia -i
46+spawn prybar-julia -i
4747match_max 100000
4848expect -exact " \[1m\[32m_\[0m\r
4949 \[1m\[34m_\[0m \[0m_\[0m \[1m\[31m_\[1m\[32m(_)\[1m\[35m_\[0m | Documentation: https://docs.julialang.org\r
5050 \[1m\[34m(_)\[0m | \[1m\[31m(_)\[0m \[1m\[35m(_)\[0m |\r
5151 \[0m_ _ _| |_ __ _\[0m | Type \"?\" for help, \"\]?\" for Pkg help.\r
5252 \[0m| | | | | | |/ _` |\[0m |\r
53− \[0m| | |_| | | | (_| |\[0m | Version 1.5.4 (2021-03-11)\r
53+ \[0m| | |_| | | | (_| |\[0m | Version 1.4.1 (2020-04-14)\r
5454 \[0m_/ |\\__'_|_|_|\\__'_|\[0m | Official https://julialang.org/ release\r
5555\[0m|__/\[0m |\r
5656\r
tests/nodejs/err.exp+9−9
@@ -8,14 +8,14 @@ send -- "x\r"
88expect -exact "x\r\r
99\[0m\[31mReferenceError: x is not defined\r
1010 at REPL1:1:1\r
11− at Script.runInThisContext (vm.js:133:18)\r
12− at REPLServer.defaultEval (repl.js:486:29)\r
13− at bound (domain.js:416:15)\r
14− at REPLServer.runBound \[as eval\] (domain.js:427:12)\r
15− at REPLServer.onLine (repl.js:819:10)\r
16− at REPLServer.emit (events.js:376:20)\r
17− at REPLServer.emit (domain.js:470:12)\r
18− at REPLServer.Interface._onLine (readline.js:342:10)\r
19− at REPLServer.Interface._line (readline.js:671:8)\[0m\[1G\[0J--> \[5G"
11+ at Script.runInThisContext (vm.js:120:18)\r
12+ at REPLServer.defaultEval (repl.js:442:29)\r
13+ at bound (domain.js:427:14)\r
14+ at REPLServer.runBound \[as eval\] (domain.js:440:12)\r
15+ at REPLServer.onLine (repl.js:777:10)\r
16+ at REPLServer.emit (events.js:314:20)\r
17+ at REPLServer.EventEmitter.emit (domain.js:483:12)\r
18+ at REPLServer.Interface._onLine (readline.js:329:10)\r
19+ at REPLServer.Interface._line (readline.js:658:8)\[0m\[1G\[0J--> \[5G"
2020send -- ""
2121expect eof
tests/tcl/1_plus_1.expnew file+11
@@ -0,0 +1,11 @@
1+#!/usr/bin/expect -f
2+
3+set timeout -1
4+spawn ./prybar-tcl -q -i
5+match_max 100000
6+expect -exact "\[J\[2K\r--> "
7+send -- "expr 1+1\r"
8+expect -exact "2\r
9+\[J\[2K\r--> "
10+send -- ""
11+expect eof