mirror of
https://github.com/nushell/nushell.git
synced 2025-08-17 03:23:34 +02:00
making empty list matches list<int> types (#11596)
# Description Fixes: #11595 The original issue is caused by #11475, we also need to make empty list matches `list type` or `table type` cc @amtoine # User-Facing Changes Nan # Tests + Formatting Done
This commit is contained in:
@ -229,6 +229,18 @@ fn type_check_for_during_eval2() -> TestResult {
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn empty_list_matches_list_type() -> TestResult {
|
||||
let _ = run_test(
|
||||
r#"def spam [foo: list<int>] { echo $foo }; spam [] | length"#,
|
||||
"0",
|
||||
);
|
||||
run_test(
|
||||
r#"def spam [foo: list<string>] { echo $foo }; spam [] | length"#,
|
||||
"0",
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn path_argument_dont_auto_expand_if_single_quoted() -> TestResult {
|
||||
run_test("def spam [foo: path] { echo $foo }; spam '~/aa'", "~/aa")
|
||||
|
Reference in New Issue
Block a user