From 121237ee4b0db24c180c8c4ec6c3a99080da6048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Wed, 14 Aug 2019 15:55:26 -0500 Subject: [PATCH] Reverted test removal from (dfcbaed) --- tests/filter_inc_tests.rs | 27 ++++++++++++++++++++++++--- tests/helpers/mod.rs | 1 - 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tests/filter_inc_tests.rs b/tests/filter_inc_tests.rs index 7c16255e48..430c3076c1 100644 --- a/tests/filter_inc_tests.rs +++ b/tests/filter_inc_tests.rs @@ -15,8 +15,8 @@ fn can_only_apply_one() { } #[test] -fn regular_field_by_one() { - Playground::setup_for("plugin_inc_by_one_test") +fn by_one_with_field_passed() { + Playground::setup_for("plugin_inc_by_one_with_field_passed_test") .with_files(vec![FileWithContent( "sample.toml", r#" @@ -27,13 +27,34 @@ fn regular_field_by_one() { nu!( output, - cwd("tests/fixtures/nuplayground/plugin_inc_by_one_test"), + cwd("tests/fixtures/nuplayground/plugin_inc_by_one_with_field_passed_test"), "open sample.toml | inc package.edition | get package.edition | echo $it" ); assert_eq!(output, "2019"); } +#[test] +fn by_one_with_no_field_passed() { + Playground::setup_for("plugin_inc_by_one_with_no_field_passed_test") + .with_files(vec![FileWithContent( + "sample.toml", + r#" + [package] + contributors = "2" + "#, + )]); + + nu!( + output, + cwd("tests/fixtures/nuplayground/plugin_inc_by_one_with_no_field_passed_test"), + "open sample.toml | get package.contributors | inc | echo $it" + ); + + assert_eq!(output, "3"); +} + + #[test] fn semversion_major_inc() { Playground::setup_for("plugin_inc_major_semversion_test") diff --git a/tests/helpers/mod.rs b/tests/helpers/mod.rs index 5defb1356a..0df348f946 100644 --- a/tests/helpers/mod.rs +++ b/tests/helpers/mod.rs @@ -150,7 +150,6 @@ impl Playground { self } - pub fn glob_vec(pattern: &str) -> Vec { glob(pattern).unwrap().map(|r| r.unwrap()).collect() }