pr: make tests compile again

This commit is contained in:
Terts Diepraam 2021-05-29 14:30:30 +02:00
parent 844e318a67
commit 0487360507
3 changed files with 13 additions and 12 deletions

19
Cargo.lock generated
View file

@ -206,6 +206,7 @@ dependencies = [
name = "coreutils"
version = "0.0.6"
dependencies = [
"chrono",
"conv",
"filetime",
"glob 0.3.0",
@ -2152,16 +2153,16 @@ dependencies = [
[[package]]
name = "uu_pr"
version = "0.0.4"
version = "0.0.6"
dependencies = [
"chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"uucore 0.0.7",
"uucore_procs 0.0.5",
"chrono",
"getopts",
"itertools 0.10.0",
"quick-error",
"regex",
"time",
"uucore",
"uucore_procs",
]
[[package]]

View file

@ -1,6 +1,6 @@
[package]
name = "uu_pr"
version = "0.0.4"
version = "0.0.6"
authors = ["uutils developers"]
license = "MIT"
description = "pr ~ (uutils) convert text files for printing"

View file

@ -205,8 +205,8 @@ impl CmdResult {
}
/// like stdout_is_fixture(...), but replaces the data in fixture file based on values provided in template_vars
/// command output
pub fn stdout_is_templated_fixture<T: AsRef<OsStr>>(&self, file_rel_path: T, template_vars: Vec<(&String, &String)>) -> Box<&CmdResult> {
let mut contents = read_scenario_fixture(&self.tmpd, file_rel_path);
pub fn stdout_is_templated_fixture<T: AsRef<OsStr>>(&self, file_rel_path: T, template_vars: Vec<(&String, &String)>) -> &CmdResult {
let mut contents = String::from_utf8(read_scenario_fixture(&self.tmpd, file_rel_path)).unwrap();
for kv in template_vars {
contents = contents.replace(kv.0, kv.1);
}