mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
echo: Add more tests
This commit is contained in:
@@ -19,6 +19,11 @@ fn test_no_trailing_newline() {
|
||||
new_ucmd!().arg("-n").arg("hi").succeeds().stdout_only("hi");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_args() {
|
||||
new_ucmd!().succeeds().stdout_only("\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_escape_alert() {
|
||||
new_ucmd!()
|
||||
@@ -523,12 +528,30 @@ fn full_version_argument() {
|
||||
.stdout_matches(&Regex::new(r"^echo \(uutils coreutils\) (\d+\.\d+\.\d+)\n$").unwrap());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multiple_version_argument() {
|
||||
new_ucmd!()
|
||||
.arg("--version")
|
||||
.arg("--version")
|
||||
.succeeds()
|
||||
.stdout_is("--version --version\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn full_help_argument() {
|
||||
assert_ne!(new_ucmd!().arg("--help").succeeds().stdout(), b"--help\n");
|
||||
assert_ne!(new_ucmd!().arg("--help").succeeds().stdout(), b"--help"); // This one is just in case.
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multiple_help_argument() {
|
||||
new_ucmd!()
|
||||
.arg("--help")
|
||||
.arg("--help")
|
||||
.succeeds()
|
||||
.stdout_is("--help --help\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multibyte_escape_unicode() {
|
||||
// spell-checker:disable-next-line
|
||||
|
||||
Reference in New Issue
Block a user