#!/usr/bin/env expect

set timeout 3
set v_root [exec sh -c "git rev-parse --show-toplevel"]

spawn $v_root/v run $v_root/examples/readline/readline.v

send "a"
expect "got 97" {} timeout { exit 1 }
send "1"
expect "got 49" {} timeout { exit 1 }
send "q"
expect "Goodbye." {} timeout { exit 1 }

expect eof
