os: add test for os.file_name (#8757)
parent
b07f373433
commit
4e2418e9cf
|
@ -415,6 +415,19 @@ fn test_base() {
|
||||||
assert os.base('filename') == 'filename'
|
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() {
|
fn test_uname() {
|
||||||
u := os.uname()
|
u := os.uname()
|
||||||
assert u.sysname.len > 0
|
assert u.sysname.len > 0
|
||||||
|
|
Loading…
Reference in New Issue