v / cmd / tools / vcreate / tests / new_with_no_arg.expect
18 lines · 13 sloc · 710 bytes · e2e5cf8db56f3562c7baa735061690be936bdf3e
Raw
1#!/usr/bin/env expect
2
3set timeout 10
4
5# Pass v_root as arg, since we chdir into a temp directory during testing and create a project there.
6set v_root [lindex $argv 0]
7set project_name [lindex $argv 1]
8
9spawn $v_root/v new
10
11expect "Input your project name: " { send "$project_name\r" } timeout { exit 1 }
12expect "Input your project description: " { send "My Awesome V Project.\r" } timeout { exit 1 }
13expect "Input your project version: (0.0.0) " { send "0.1.0\r" } timeout { exit 1 }
14expect "Input your project license: (MIT) " { send "GPL\r" } timeout { exit 1 }
15expect "Initialising ..." {} timeout { exit 1 }
16expect "Created binary (application) project `$project_name`" {} timeout { exit 1 }
17
18expect eof
19