mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Add insert and update back (#4864)
This commit is contained in:
28
crates/nu-command/tests/commands/insert.rs
Normal file
28
crates/nu-command/tests/commands/insert.rs
Normal file
@ -0,0 +1,28 @@
|
||||
use nu_test_support::{nu, pipeline};
|
||||
|
||||
#[test]
|
||||
fn insert_the_column() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open cargo_sample.toml
|
||||
| insert dev-dependencies.new_assertions "0.7.0"
|
||||
| get dev-dependencies.new_assertions
|
||||
"#
|
||||
));
|
||||
|
||||
assert_eq!(actual.out, "0.7.0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn insert_the_column_conflict() {
|
||||
let actual = nu!(
|
||||
cwd: "tests/fixtures/formats", pipeline(
|
||||
r#"
|
||||
open cargo_sample.toml
|
||||
| insert dev-dependencies.pretty_assertions "0.7.0"
|
||||
"#
|
||||
));
|
||||
|
||||
assert!(actual.err.contains("column already exists"));
|
||||
}
|
Reference in New Issue
Block a user