mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: add test for os.file_name (#8757)
This commit is contained in:
parent
b07f373433
commit
4e2418e9cf
@ -415,6 +415,19 @@ fn test_base() {
|
||||
assert os.base('filename') == 'filename'
|
||||
}
|
||||
|
||||
fn test_file_name() {
|
||||
$if windows {
|
||||
assert os.file_name('v\\vlib\\os\\os.v') == 'os.v'
|
||||
assert os.file_name('v\\vlib\\os\\') == ''
|
||||
assert os.file_name('v\\vlib\\os') == 'os'
|
||||
} $else {
|
||||
assert os.file_name('v/vlib/os/os.v') == 'os.v'
|
||||
assert os.file_name('v/vlib/os/') == ''
|
||||
assert os.file_name('v/vlib/os') == 'os'
|
||||
}
|
||||
assert os.file_name('filename') == 'filename'
|
||||
}
|
||||
|
||||
fn test_uname() {
|
||||
u := os.uname()
|
||||
assert u.sysname.len > 0
|
||||
|
Loading…
Reference in New Issue
Block a user