2
0
Fork 0
mirror of https://github.com/nushell/nushell synced 2025-02-15 13:38:41 +00:00
nushell/tests/tests.rs

42 lines
980 B
Rust
Raw Normal View History

mod helpers;
2019-06-02 15:37:09 +12:00
use helpers::in_directory as cwd;
2019-06-02 15:37:09 +12:00
#[test]
fn external_num() {
2019-07-22 15:52:57 +12:00
nu!(
output,
cwd("tests/fixtures/formats"),
2019-07-22 15:52:57 +12:00
"open sgml_description.json | get glossary.GlossDiv.GlossList.GlossEntry.Height | echo $it"
);
assert_eq!(output, "10");
}
2019-06-24 19:59:23 +12:00
#[test]
fn inc_plugin() {
nu!(output,
cwd("tests/fixtures/formats"),
"open sgml_description.json | get glossary.GlossDiv.GlossList.GlossEntry.Height | inc | echo $it");
2019-07-04 15:18:19 +12:00
assert_eq!(output, "11");
2019-06-03 13:26:29 +12:00
}
2019-07-22 15:52:57 +12:00
#[test]
fn add_plugin() {
nu!(output,
cwd("tests/fixtures/formats"),
"open cargo_sample.toml | add dev-dependencies.newdep \"1\" | get dev-dependencies.newdep | echo $it");
assert_eq!(output, "1");
}
#[test]
fn edit_plugin() {
nu!(output,
cwd("tests/fixtures/formats"),
"open cargo_sample.toml | edit dev-dependencies.pretty_assertions \"7\" | get dev-dependencies.pretty_assertions | echo $it");
assert_eq!(output, "7");
}