Skip to content

Commit 22fd0af

Browse files
committed
refactor: use pipe
1 parent bf66a60 commit 22fd0af

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

tests/sync_help.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
use clap::CommandFactory;
1111
use parallel_disk_usage::{args::Args, usage_md::render_usage_md};
12+
use pipe_trait::Pipe;
1213

1314
fn normalize_help(text: &str) -> String {
1415
text.lines()
@@ -19,7 +20,10 @@ fn normalize_help(text: &str) -> String {
1920

2021
#[test]
2122
fn long_help_is_up_to_date() {
22-
let actual = normalize_help(&Args::command().render_long_help().to_string());
23+
let actual = Args::command()
24+
.render_long_help()
25+
.to_string()
26+
.pipe_as_ref(normalize_help);
2327
let expected = normalize_help(include_str!("../exports/long.help"));
2428
assert!(
2529
actual.trim_end() == expected.trim_end(),
@@ -29,7 +33,10 @@ fn long_help_is_up_to_date() {
2933

3034
#[test]
3135
fn short_help_is_up_to_date() {
32-
let actual = normalize_help(&Args::command().render_help().to_string());
36+
let actual = Args::command()
37+
.render_help()
38+
.to_string()
39+
.pipe_as_ref(normalize_help);
3340
let expected = normalize_help(include_str!("../exports/short.help"));
3441
assert!(
3542
actual.trim_end() == expected.trim_end(),

0 commit comments

Comments
 (0)