mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
move all vlib modules to vlib/
This commit is contained in:
21
vlib/os/os_test.v
Normal file
21
vlib/os/os_test.v
Normal file
@@ -0,0 +1,21 @@
|
||||
import os
|
||||
|
||||
fn test_setenv() {
|
||||
os.setenv('foo', 'bar', true)
|
||||
assert os.getenv('foo') == 'bar'
|
||||
|
||||
// `setenv` should not set if `overwrite` is false
|
||||
os.setenv('foo', 'bar2', false)
|
||||
assert os.getenv('foo') == 'bar'
|
||||
|
||||
// `setenv` should overwrite if `overwrite` is true
|
||||
os.setenv('foo', 'bar2', true)
|
||||
assert os.getenv('foo') == 'bar2'
|
||||
}
|
||||
|
||||
fn test_unsetenv() {
|
||||
os.setenv('foo', 'bar', true)
|
||||
os.unsetenv('foo')
|
||||
assert os.getenv('foo') == ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user