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:
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user