From 5bfa2cc4b82d40dc64b6c90846b5c1ed66a6ee7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Fri, 9 Aug 2019 01:52:48 -0500 Subject: [PATCH] cp wildcard already supported (documented with test) --- tests/command_cp_tests.rs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/command_cp_tests.rs b/tests/command_cp_tests.rs index ef2a68c36..2907155e8 100644 --- a/tests/command_cp_tests.rs +++ b/tests/command_cp_tests.rs @@ -146,7 +146,7 @@ fn deep_copies_with_recursive_flag() { } #[test] -fn copies_using_globs() { +fn copies_using_path_with_wildcard() { let sandbox = Playground::setup_for("cp_test_6").test_dir_name(); let expected_copies_path = format!("{}/{}", Playground::root(), sandbox); @@ -167,3 +167,26 @@ fn copies_using_globs() { PathBuf::from(&expected_copies_path) )); } + +#[test] +fn copies_using_a_glob() { + let sandbox = Playground::setup_for("cp_test_7").test_dir_name(); + let expected_copies_path = format!("{}/{}", Playground::root(), sandbox); + + nu!( + _output, + cwd("tests/fixtures/formats"), + "cp * ../nuplayground/cp_test_7" + ); + + assert!(h::files_exist_at( + vec![ + Path::new("caco3_plastics.csv"), + Path::new("cargo_sample.toml"), + Path::new("jonathan.xml"), + Path::new("sample.ini"), + Path::new("sgml_description.json") + ], + PathBuf::from(&expected_copies_path) + )); +}