v / cmd / tools / vcreate / tests / new_with_model_arg.expect
18 lines · 13 sloc · 661 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 model [lindex $argv 1]
8set project_name [lindex $argv 2]
9
10spawn $v_root/v new $model $project_name
11
12expect "Input your project description: " { send "My Awesome V Project.\r" } timeout { exit 1 }
13expect "Input your project version: (0.0.0) " { send "0.0.1\r" } timeout { exit 1 }
14expect "Input your project license: (MIT) " { send "\r" } timeout { exit 1 }
15expect "Initialising ..." {} timeout { exit 1 }
16expect "Created library project `$project_name`" {} timeout { exit 1 }
17
18expect eof
19