mirror of
https://github.com/nushell/nushell
synced 2025-01-04 09:18:57 +00:00
d128c0e02b
Should close #8809. # Description this PR uses the automatically loaded library from the tests by replacing `use std.nu ...` with `use std ...`. the `README` has been updated by - removing the very deprencated "concrete examples" - fixing the `use std` and the "run the tests" sections the `README` can be previewed [here](https://github.com/amtoine/nushell/blob/refactor/stdlib/use-std-in-tests-and-update-readme/crates/nu-std/README.md) 👍 # User-Facing Changes ``` $nothing ``` # Tests + Formatting - 🟢 `toolkit test stdlib` # After Submitting ``` $nothing ```
24 lines
599 B
Text
24 lines
599 B
Text
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"]
|
|
}
|
|
}
|