mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 04:17:46 +02:00
Finish adding support for optional params (#530)
This commit is contained in:
@ -1300,3 +1300,11 @@ fn get_table_columns_1() -> TestResult {
|
||||
fn get_table_columns_2() -> TestResult {
|
||||
run_test("[[name, age, grade]; [paul,21,a]] | columns | nth 1", "age")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn allow_missing_optional_params() -> TestResult {
|
||||
run_test(
|
||||
"def foo [x?:int] { if $x != $nothing { $x + 10 } else { 5 } }; foo",
|
||||
"5",
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user