mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Move alias type inference (experimental) behind --infer/-i flag (#2418)
* put alias type inference behind --infer/-i flag * revert cargo.lock
This commit is contained in:
@ -22,7 +22,7 @@ fn alias_parses_path_tilde() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats",
|
||||
r#"
|
||||
alias new-cd [dir] { cd $dir }
|
||||
alias -i new-cd [dir] { cd $dir }
|
||||
new-cd ~
|
||||
pwd
|
||||
"#
|
||||
@ -39,7 +39,7 @@ fn error_alias_wrong_shape_shallow() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
alias round-to [num digits] { echo $num | str from -d $digits }
|
||||
alias -i round-to [num digits] { echo $num | str from -d $digits }
|
||||
round-to 3.45 a
|
||||
"#
|
||||
);
|
||||
@ -52,7 +52,7 @@ fn error_alias_wrong_shape_deep_invocation() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
alias round-to [nums digits] { echo $nums | each {= $(str from -d $digits)}}
|
||||
alias -i round-to [nums digits] { echo $nums | each {= $(str from -d $digits)}}
|
||||
round-to 3.45 a
|
||||
"#
|
||||
);
|
||||
@ -65,7 +65,7 @@ fn error_alias_wrong_shape_deep_binary() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
alias round-plus-one [nums digits] { echo $nums | each {= $(str from -d $digits | str to-decimal) + 1}}
|
||||
alias -i round-plus-one [nums digits] { echo $nums | each {= $(str from -d $digits | str to-decimal) + 1}}
|
||||
round-plus-one 3.45 a
|
||||
"#
|
||||
);
|
||||
@ -78,7 +78,7 @@ fn error_alias_wrong_shape_deeper_binary() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
alias round-one-more [num digits] { echo $num | str from -d $(= $digits + 1) }
|
||||
alias -i round-one-more [num digits] { echo $num | str from -d $(= $digits + 1) }
|
||||
round-one-more 3.45 a
|
||||
"#
|
||||
);
|
||||
@ -91,7 +91,7 @@ fn error_alias_syntax_shape_clash() {
|
||||
let actual = nu!(
|
||||
cwd: ".",
|
||||
r#"
|
||||
alias clash [a] { echo 1.1 2 3 | each { str from -d $a } | range $a } }
|
||||
alias -i clash [a] { echo 1.1 2 3 | each { str from -d $a } | range $a } }
|
||||
"#
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user