mirror of
https://github.com/nushell/nushell.git
synced 2025-01-14 02:08:51 +01:00
5d8bedfbe4
# Description as we now have a prelude thanks to #8627, i'd like to work on the structure of the library 😋 and i think the first step is to make it a true standalone crate 😏 this PR - moves all the library from `crates/nu-utils/standard_library/` to `crates/nu-std/` - moves the `rust` loading code from `src/run.rs` to `crates/nu-std/src/lib.rs`
25 lines
605 B
Plaintext
25 lines
605 B
Plaintext
use std.nu
|
|
|
|
export def test_path_add [] {
|
|
use std.nu "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"]
|
|
}
|
|
}
|