mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: fix is_abs_path function for Windows systems (#14397)
This commit is contained in:
29
vlib/os/filepath_test.v
Normal file
29
vlib/os/filepath_test.v
Normal file
@ -0,0 +1,29 @@
|
||||
module os
|
||||
|
||||
fn test_is_abs_path() {
|
||||
$if windows {
|
||||
assert is_abs_path('/')
|
||||
assert is_abs_path('\\')
|
||||
assert !is_abs_path('\\\\')
|
||||
assert is_abs_path(r'C:\path\to\files\file.v')
|
||||
assert is_abs_path(r'\\Host\share')
|
||||
assert is_abs_path(r'//Host\share\files\file.v')
|
||||
assert is_abs_path(r'\\.\BootPartition\Windows')
|
||||
assert !is_abs_path(r'\\.\')
|
||||
assert !is_abs_path(r'\\?\\')
|
||||
assert !is_abs_path(r'C:path\to\dir')
|
||||
assert !is_abs_path(r'dir')
|
||||
assert !is_abs_path(r'.\')
|
||||
assert !is_abs_path(r'.')
|
||||
assert !is_abs_path(r'\\Host')
|
||||
assert !is_abs_path(r'\\Host\')
|
||||
return
|
||||
}
|
||||
assert is_abs_path('/')
|
||||
assert is_abs_path('/path/to/files/file.v')
|
||||
assert !is_abs_path('\\')
|
||||
assert !is_abs_path('path/to/files/file.v')
|
||||
assert !is_abs_path('dir')
|
||||
assert !is_abs_path('./')
|
||||
assert !is_abs_path('.')
|
||||
}
|
Reference in New Issue
Block a user