mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
tools.vcreate: rework cli arg handling to extend scaffolding and fix issues (#19889)
This commit is contained in:
parent
9308bcd48a
commit
e9258c2a08
16 changed files with 237 additions and 139 deletions
|
@ -68,12 +68,13 @@ fn test_new_with_name_arg_input() {
|
|||
fn test_new_with_model_arg_input() {
|
||||
prepare_test_path()!
|
||||
project_name := 'my_lib'
|
||||
model := 'lib'
|
||||
os.execute_opt('${expect_exe} ${os.join_path(expect_tests_path, 'new_with_model_arg.expect')} ${vroot} ${project_name} ${model}') or {
|
||||
model := '--lib'
|
||||
os.execute_opt('${expect_exe} ${os.join_path(expect_tests_path, 'new_with_model_arg.expect')} ${vroot} ${model} ${project_name}') or {
|
||||
assert false, err.msg()
|
||||
}
|
||||
project_path := os.join_path(test_module_path, project_name)
|
||||
// Assert mod data set in `new_with_model_arg.expect`.
|
||||
mod := vmod.from_file(os.join_path(test_module_path, project_name, 'v.mod')) or {
|
||||
mod := vmod.from_file(os.join_path(project_path, 'v.mod')) or {
|
||||
assert false, err.str()
|
||||
return
|
||||
}
|
||||
|
@ -81,4 +82,6 @@ fn test_new_with_model_arg_input() {
|
|||
assert mod.description == 'My Awesome V Project.'
|
||||
assert mod.version == '0.0.1'
|
||||
assert mod.license == 'MIT'
|
||||
// Assert existence of a model-specific file.
|
||||
assert os.exists(os.join_path(project_path, 'tests', 'square_test.v'))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue