mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 03:46:00 +02:00
stdlib: refactor into a multi-module library (#8815)
This commit is contained in:
24
crates/nu-std/tests/test_std.nu
Normal file
24
crates/nu-std/tests/test_std.nu
Normal file
@@ -0,0 +1,24 @@
|
||||
use std
|
||||
|
||||
export def test_path_add [] {
|
||||
use std "assert equal"
|
||||
|
||||
with-env [PATH []] {
|
||||
assert equal $env.PATH []
|
||||
|
||||
std path add "/foo/"
|
||||
assert equal $env.PATH ["/foo/"]
|
||||
|
||||
std path add "/bar/" "/baz/"
|
||||
assert equal $env.PATH ["/bar/", "/baz/", "/foo/"]
|
||||
|
||||
let-env PATH = []
|
||||
|
||||
std path add "foo"
|
||||
std path add "bar" "baz" --append
|
||||
assert equal $env.PATH ["foo", "bar", "baz"]
|
||||
|
||||
assert equal (std path add "fooooo" --ret) ["fooooo", "foo", "bar", "baz"]
|
||||
assert equal $env.PATH ["fooooo", "foo", "bar", "baz"]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user