1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: fix repl_test.v

This commit is contained in:
Delyan Angelov 2020-08-25 15:59:07 +03:00
parent ceca1547fb
commit 1619beda91
2 changed files with 8 additions and 2 deletions

View File

@ -265,7 +265,12 @@ pub fn (v &Builder) get_user_files() []string {
user_files << single_test_v_file
dir = os.base_dir(single_test_v_file)
}
is_real_file := os.exists(dir) && !os.is_dir(dir)
does_exist := os.exists(dir)
if !does_exist {
verror("$dir doesn't exist")
exit(1)
}
is_real_file := does_exist && !os.is_dir(dir)
if is_real_file && (dir.ends_with('.v') || dir.ends_with('.vsh') || dir.ends_with('.vv')) {
single_v_file := dir
// Just compile one file and get parent dir

View File

@ -21,7 +21,8 @@ fn test_the_v_compiler_can_be_invoked() {
}
// println('"$vcmd_error" exit_code: $r_error.exit_code | output: $r_error.output')
assert r_error.exit_code == 1
assert r_error.output.trim_space() == "builder error: nonexisting.v doesn't exist"
actual_error := r_error.output.trim_space()
assert actual_error == "builder error: nonexisting.v doesn't exist"
}
struct Session {