2023-04-08 12:35:16 +00:00
|
|
|
use std
|
2023-03-16 18:23:29 +00:00
|
|
|
|
|
|
|
export def test_path_add [] {
|
2023-04-08 12:35:16 +00:00
|
|
|
use std "assert equal"
|
2023-03-16 18:23:29 +00:00
|
|
|
|
|
|
|
with-env [PATH []] {
|
2023-03-20 13:57:28 +00:00
|
|
|
assert equal $env.PATH []
|
2023-03-16 18:23:29 +00:00
|
|
|
|
|
|
|
std path add "/foo/"
|
2023-03-20 13:57:28 +00:00
|
|
|
assert equal $env.PATH ["/foo/"]
|
2023-03-16 18:23:29 +00:00
|
|
|
|
|
|
|
std path add "/bar/" "/baz/"
|
2023-03-20 13:57:28 +00:00
|
|
|
assert equal $env.PATH ["/bar/", "/baz/", "/foo/"]
|
2023-03-16 18:23:29 +00:00
|
|
|
|
|
|
|
let-env PATH = []
|
|
|
|
|
|
|
|
std path add "foo"
|
|
|
|
std path add "bar" "baz" --append
|
2023-03-20 13:57:28 +00:00
|
|
|
assert equal $env.PATH ["foo", "bar", "baz"]
|
2023-03-16 18:23:29 +00:00
|
|
|
|
2023-03-20 13:57:28 +00:00
|
|
|
assert equal (std path add "fooooo" --ret) ["fooooo", "foo", "bar", "baz"]
|
|
|
|
assert equal $env.PATH ["fooooo", "foo", "bar", "baz"]
|
2023-03-16 18:23:29 +00:00
|
|
|
}
|
|
|
|
}
|
2023-05-10 12:05:01 +00:00
|
|
|
|
|
|
|
export def test_banner [] {
|
|
|
|
std assert ((std banner | lines | length) == 15)
|
|
|
|
}
|