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

os: let os.dir("/xyz") return "/" (fixes compiling .v files in /)

This commit is contained in:
Delyan Angelov
2021-07-30 03:14:09 +03:00
parent 7c504920e1
commit 44892fd942
2 changed files with 5 additions and 0 deletions

View File

@ -534,6 +534,8 @@ fn test_dir() {
assert os.dir('C:\\a\\b\\c') == 'C:\\a\\b'
assert os.dir('C:\\a\\b\\') == 'C:\\a\\b'
} $else {
assert os.dir('/') == '/'
assert os.dir('/abc') == '/'
assert os.dir('/var/tmp/foo') == '/var/tmp'
assert os.dir('/var/tmp/') == '/var/tmp'
}