forked from extern/nushell
c52d45cb97
* start working on source-env * WIP * Get most tests working, still one to go * Fix file-relative paths; Report parser error * Fix merge conflicts; Restore source as deprecated * Tests: Use source-env; Remove redundant tests * Fmt * Respect hidden env vars * Fix file-relative eval for source-env * Add file-relative eval to "overlay use" * Use FILE_PWD only in source-env and "overlay use" * Ignore new tests for now This will be another issue * Throw an error if setting FILE_PWD manually * Fix source-related test failures * Fix nu-check to respect FILE_PWD * Fix corrupted spans in source-env shell errors * Fix up some references to old source * Remove deprecation message * Re-introduce deleted tests Co-authored-by: kubouch <kubouch@gmail.com>
43 lines
866 B
Rust
43 lines
866 B
Rust
use nu_test_support::{nu, pipeline};
|
|
|
|
#[test]
|
|
fn alias_simple() {
|
|
let actual = nu!(
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
r#"
|
|
alias bar = use sample_def.nu greet;
|
|
bar;
|
|
greet
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "hello");
|
|
}
|
|
|
|
#[test]
|
|
fn alias_hiding_1() {
|
|
let actual = nu!(
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
r#"
|
|
overlay use ./activate-foo.nu;
|
|
$nu.scope.aliases | find deactivate-foo | length
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "1");
|
|
}
|
|
|
|
#[test]
|
|
fn alias_hiding_2() {
|
|
let actual = nu!(
|
|
cwd: "tests/fixtures/formats", pipeline(
|
|
r#"
|
|
overlay use ./activate-foo.nu;
|
|
deactivate-foo;
|
|
$nu.scope.aliases | find deactivate-foo | length
|
|
"#
|
|
));
|
|
|
|
assert_eq!(actual.out, "0");
|
|
}
|