mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Simplify expressions (#3389)
* WIP: experiment with simpler expressions * fix simple invoke * update tests * fix a few tests * Make paren parsing more robust * fix external args * Remove old invocation * Update tests * Update tests
This commit is contained in:
@ -6,9 +6,9 @@ fn reports_emptiness() {
|
||||
cwd: ".", pipeline(
|
||||
r#"
|
||||
echo [[are_empty];
|
||||
[$(= [[check]; [[]] ])]
|
||||
[$(= [[check]; [""] ])]
|
||||
[$(= [[check]; [$(wrap)] ])]
|
||||
[([[check]; [[]] ])]
|
||||
[([[check]; [""] ])]
|
||||
[([[check]; [(wrap)] ])]
|
||||
]
|
||||
| get are_empty
|
||||
| empty? check
|
||||
@ -32,7 +32,7 @@ fn sets_block_run_value_for_an_empty_column() {
|
||||
[ Jason, Gedge, 10/11/2013, 1 ]
|
||||
[ Yehuda, Katz, 10/11/2013, '' ]
|
||||
]
|
||||
| empty? likes { = 1 }
|
||||
| empty? likes { 1 }
|
||||
| get likes
|
||||
| math sum
|
||||
"#
|
||||
@ -50,9 +50,9 @@ fn sets_block_run_value_for_many_empty_columns() {
|
||||
[ boost check ];
|
||||
[ 1, [] ]
|
||||
[ 1, "" ]
|
||||
[ 1, $(wrap) ]
|
||||
[ 1, (wrap) ]
|
||||
]
|
||||
| empty? boost check { = 1 }
|
||||
| empty? boost check { 1 }
|
||||
| get boost check
|
||||
| math sum
|
||||
"#
|
||||
@ -73,9 +73,9 @@ fn passing_a_block_will_set_contents_on_empty_cells_and_leave_non_empty_ones_unt
|
||||
[ Arepas, "", "" ]
|
||||
[ Jorge, 30, 3000 ]
|
||||
]
|
||||
| empty? LVL { = 9 }
|
||||
| empty? LVL { 9 }
|
||||
| empty? HP {
|
||||
= $it.LVL * 1000
|
||||
$it.LVL * 1000
|
||||
}
|
||||
| math sum
|
||||
| get HP
|
||||
|
Reference in New Issue
Block a user