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

os api: basedir => base_dir

This commit is contained in:
yuyi
2020-03-08 22:43:56 +08:00
committed by GitHub
parent 2bed0d1bb5
commit 23b11c84b1
8 changed files with 11 additions and 11 deletions

View File

@ -667,7 +667,7 @@ pub fn dir(path string) string {
return path[..pos]
}
pub fn basedir(path string) string {
pub fn base_dir(path string) string {
pos := path.last_index(path_separator) or {
return path
}

View File

@ -325,12 +325,12 @@ fn test_dir() {
fn test_basedir() {
$if windows {
assert os.basedir('v\\vlib\\os') == 'v\\vlib'
assert os.base_dir('v\\vlib\\os') == 'v\\vlib'
} $else {
assert os.basedir('v/vlib/os') == 'v/vlib'
assert os.base_dir('v/vlib/os') == 'v/vlib'
}
assert os.basedir('filename') == 'filename'
assert os.base_dir('filename') == 'filename'
}
// this function is called by both test_aaa_setup & test_zzz_cleanup