| 1 | #!/usr/bin/env expect |
| 2 | |
| 3 | set timeout 3 |
| 4 | set v_root [exec sh -c "git rev-parse --show-toplevel"] |
| 5 | # Use input arguments for send and expect. |
| 6 | set send_ [lindex $argv 0] |
| 7 | set expect_ [lindex $argv 1] |
| 8 | |
| 9 | spawn $v_root/v run $v_root/examples/readline/readline.v |
| 10 | |
| 11 | send $send_ |
| 12 | expect $expect_ {} timeout { exit 1 } |
| 13 | |
| 14 | expect eof |
| 15 |