mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Disable alias recursion (for real) (#8557)
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use nu_test_support::fs::Stub::FileWithContentToBeTrimmed;
|
||||
use nu_test_support::playground::Playground;
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[ignore = "TODO?: Aliasing parser keywords does not work anymore"]
|
||||
@ -110,3 +112,28 @@ fn alias_wont_recurse() {
|
||||
assert_eq!(actual.out, "hello world");
|
||||
assert!(actual.err.is_empty());
|
||||
}
|
||||
|
||||
// Issue https://github.com/nushell/nushell/issues/8246
|
||||
#[test]
|
||||
fn alias_wont_recurse2() {
|
||||
Playground::setup("alias_wont_recurse2", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![FileWithContentToBeTrimmed(
|
||||
"spam.nu",
|
||||
r#"
|
||||
def eggs [] { spam 'eggs' }
|
||||
alias spam = spam 'spam'
|
||||
"#,
|
||||
)]);
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(), pipeline(
|
||||
r#"
|
||||
def spam [what: string] { 'spam ' + $what };
|
||||
source spam.nu;
|
||||
spam
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "spam spam");
|
||||
assert!(actual.err.is_empty());
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user