Skip to content

Commit

Permalink
update structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 7, 2023
1 parent 8205b02 commit d4dde67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
File renamed without changes.
8 changes: 5 additions & 3 deletions cmd/tools/vcreate/vcreate_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,22 @@ fn test_input() {
eprintln('Input test for windows are not yet implemented.')
return
}
expect_path := os.join_path(@VMODROOT, 'cmd', 'tools', 'vcreate')
expect_tests_path := os.join_path(@VMODROOT, 'cmd', 'tools', 'vcreate', 'tests')

// The expect script will create a new project in the temporary `test_path` directory.
project_name := 'my_project'
new_no_arg := os.execute(os.join_path(expect_path, 'new_no_arg.expect ${@VMODROOT} ${project_name}'))
new_no_arg := os.execute('${os.join_path(expect_tests_path, 'new_no_arg.expect')} ${@VMODROOT} ${project_name}')
if new_no_arg.exit_code != 0 {
assert false, new_no_arg.output
}
// Assert mod data set in `new_no_arg.expect`.
mod := vmod.decode(os.read_file(os.join_path(test_path, project_name, 'v.mod')) or {
assert false, 'Failed reading v.mod of ${project_name}'
return
}) or {
assert false, err.str()
return
}
// Assert module data set in ./new_no_arg.expect
assert mod.name == 'my_project'
assert mod.description == 'My awesome V project.'
assert mod.version == '0.1.0'
Expand Down

0 comments on commit d4dde67

Please sign in to comment.