diff --git a/crates/nu-command/src/conversions/into/cell_path.rs b/crates/nu-command/src/conversions/into/cell_path.rs index 462d425e35..7f7e24ee99 100644 --- a/crates/nu-command/src/conversions/into/cell_path.rs +++ b/crates/nu-command/src/conversions/into/cell_path.rs @@ -93,11 +93,12 @@ impl Command for IntoCellPath { }, Example { description: "Convert table into cell path", - example: "[[value, optional]; [5 true] [c false]] | into cell-path", + example: "[[value, optional, insensitive]; [5 true false] [c false false] [d false true]] | into cell-path", result: Some(Value::test_cell_path(CellPath { members: vec![ PathMember::test_int(5, true), PathMember::test_string("c".into(), false, false), + PathMember::test_string("d".into(), false, true), ], })), }, diff --git a/crates/nu-command/src/conversions/split_cell_path.rs b/crates/nu-command/src/conversions/split_cell_path.rs index 2708a7d6ed..173190fb83 100644 --- a/crates/nu-command/src/conversions/split_cell_path.rs +++ b/crates/nu-command/src/conversions/split_cell_path.rs @@ -77,36 +77,43 @@ impl Command for SplitCellPath { Value::test_record(record! { "value" => Value::test_int(5), "optional" => Value::test_bool(true), + "insensitive" => Value::test_bool(false), }), Value::test_record(record! { "value" => Value::test_string("c"), "optional" => Value::test_bool(false), + "insensitive" => Value::test_bool(false), }), ])), }, Example { description: "Split a complex cell-path", - example: r#"$.a.b?.1."2"."c.d" | split cell-path"#, + example: r#"$.a!.b?.1."2"."c.d" | split cell-path"#, result: Some(Value::test_list(vec![ Value::test_record(record! { "value" => Value::test_string("a"), "optional" => Value::test_bool(false), + "insensitive" => Value::test_bool(true), }), Value::test_record(record! { "value" => Value::test_string("b"), "optional" => Value::test_bool(true), + "insensitive" => Value::test_bool(false), }), Value::test_record(record! { "value" => Value::test_int(1), "optional" => Value::test_bool(false), + "insensitive" => Value::test_bool(false), }), Value::test_record(record! { "value" => Value::test_string("2"), "optional" => Value::test_bool(false), + "insensitive" => Value::test_bool(false), }), Value::test_record(record! { "value" => Value::test_string("c.d"), "optional" => Value::test_bool(false), + "insensitive" => Value::test_bool(false), }), ])), }, diff --git a/tests/repl/test_table_operations.rs b/tests/repl/test_table_operations.rs index 5d61e0d902..0a975c2c1b 100644 --- a/tests/repl/test_table_operations.rs +++ b/tests/repl/test_table_operations.rs @@ -307,7 +307,7 @@ fn nullify_holes() -> TestResult { #[test] fn get_insensitive() -> TestResult { run_test( - r#"[[name, age]; [a, 1] [b, 2]] | get NAmE | select 0 | get 0"#, + r#"[[name, age]; [a, 1] [b, 2]] | get -I NAmE | select 0 | get 0"#, "a", ) }