1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Fix "coreutils manpage base64" bug

This commit is contained in:
Andrew Liebenow 2024-10-05 08:17:10 -05:00
parent 9fa405fad6
commit 32e1c54c78
10 changed files with 103 additions and 91 deletions

View file

@ -185,3 +185,38 @@ cyBvdmVyIHRoZSBsYXp5IGRvZy4=
// cSpell:enable
);
}
// Prevent regression to:
//
// coreutils manpage base64 | rg --fixed-strings -- 'base32'
// The data are encoded as described for the base32 alphabet in RFC 4648.
// to the bytes of the formal base32 alphabet. Use \-\-ignore\-garbage
// The data are encoded as described for the base32 alphabet in RFC 4648.
// to the bytes of the formal base32 alphabet. Use \-\-ignore\-garbage
#[test]
fn test_manpage() {
use std::process::{Command, Stdio};
let test_scenario = TestScenario::new("");
let child = Command::new(test_scenario.bin_path)
.arg("manpage")
.arg("base64")
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.unwrap();
let output = child.wait_with_output().unwrap();
assert_eq!(output.status.code().unwrap(), 0);
assert!(output.stderr.is_empty());
let stdout_str = std::str::from_utf8(&output.stdout).unwrap();
assert!(stdout_str.contains("base64 alphabet"));
assert!(!stdout_str.to_ascii_lowercase().contains("base32"));
}