mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
allow tables in ++ operator (#7051)
This PR closes #6916, which now allows table/table operations on the `++` operator. ``` [[a b]; [1 2]] ++ [[a b]; [1 3]] ╭───┬───┬───╮ │ # │ a │ b │ ├───┼───┼───┤ │ 0 │ 1 │ 2 │ │ 1 │ 1 │ 3 │ ╰───┴───┴───╯ ```
This commit is contained in:
@ -509,3 +509,14 @@ fn adding_value_and_list() {
|
||||
|
||||
assert_eq!(actual.out, "[1, 3, 5]");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn adding_tables() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
[[a b]; [1 2]] ++ [[4 5]; [10 11]] | to nuon
|
||||
"#
|
||||
));
|
||||
assert_eq!(actual.out, "[{a: 1, b: 2}, {4: 10, 5: 11}]");
|
||||
}
|
||||
|
Reference in New Issue
Block a user