From 992c113f09665aa64f62616cd9aedbeeecc788e5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 21 Jan 2021 21:19:04 +0100 Subject: [PATCH] Remove some old code --- src/uu/cut/src/buffer.rs | 2 +- tests/by-util/test_realpath.rs | 1 - tests/common/util.rs | 34 ---------------------------------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/uu/cut/src/buffer.rs b/src/uu/cut/src/buffer.rs index 7ee26612e..6c3238be1 100644 --- a/src/uu/cut/src/buffer.rs +++ b/src/uu/cut/src/buffer.rs @@ -107,7 +107,7 @@ impl self::Bytes::Select for ByteReader { Comp, Part, Newl, - }; + } use self::Bytes::Selected::*; diff --git a/tests/by-util/test_realpath.rs b/tests/by-util/test_realpath.rs index b4c78cbaa..750a8db01 100644 --- a/tests/by-util/test_realpath.rs +++ b/tests/by-util/test_realpath.rs @@ -90,7 +90,6 @@ fn test_file_and_links_strip() { fn test_file_and_links_strip_zero() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; - let result = scene.ucmd().run(); at.touch("foo"); at.symlink_file("foo", "bar"); diff --git a/tests/common/util.rs b/tests/common/util.rs index 3891c7692..117bce0e6 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -137,12 +137,6 @@ impl CmdResult { Box::new(self) } - /// like stderr_is(...), but expects the contents of the file at the provided relative path - pub fn stderr_is_fixture>(&self, file_rel_path: T) -> Box<&CmdResult> { - let contents = read_scenario_fixture(&self.tmpd, file_rel_path); - self.stderr_is(contents) - } - /// asserts that /// 1. the command resulted in stdout stream output that equals the /// passed in value, when both are trimmed of trailing whitespace @@ -165,12 +159,6 @@ impl CmdResult { self.no_stdout().stderr_is(msg) } - /// like stderr_only(...), but expects the contents of the file at the provided relative path - pub fn stderr_only_fixture>(&self, file_rel_path: T) -> Box<&CmdResult> { - let contents = read_scenario_fixture(&self.tmpd, file_rel_path); - self.stderr_only(contents) - } - pub fn fails_silently(&self) -> Box<&CmdResult> { assert!(!self.success); assert_eq!(self.stderr, ""); @@ -360,22 +348,6 @@ impl AtPath { } } - pub fn cleanup(&self, path: &'static str) { - let p = &self.plus(path); - if let Ok(m) = fs::metadata(p) { - if m.is_file() { - fs::remove_file(&p).unwrap(); - } else { - fs::remove_dir(&p).unwrap(); - } - } - } - - pub fn root_dir(&self) -> String { - log_info("current_directory", ""); - self.subdir.to_str().unwrap().to_owned() - } - pub fn root_dir_resolved(&self) -> String { log_info("current_directory_resolved", ""); let s = self @@ -525,12 +497,6 @@ impl UCommand { Box::new(self) } - /// like arg(...), but uses the contents of the file at the provided relative path as the argument - pub fn arg_fixture>(&mut self, file_rel_path: S) -> Box<&mut UCommand> { - let contents = read_scenario_fixture(&self.tmpd, file_rel_path); - self.arg(contents) - } - pub fn args>(&mut self, args: &[S]) -> Box<&mut UCommand> { if self.has_run { panic!(MULTIPLE_STDIN_MEANINGLESS);