1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

Merge pull request #6997 from cakebaker/echo_handle_double_hyphen

echo: handle double hyphens
This commit is contained in:
Sylvestre Ledru 2024-12-26 12:19:07 +01:00 committed by GitHub
commit b4cdc36573
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 7 deletions

View file

@ -219,8 +219,7 @@ fn test_hyphen_values_at_start() {
.arg("-test")
.arg("araba")
.arg("-merci")
.run()
.success()
.succeeds()
.stdout_does_not_contain("-E")
.stdout_is("-test araba -merci\n");
}
@ -231,8 +230,7 @@ fn test_hyphen_values_between() {
.arg("test")
.arg("-E")
.arg("araba")
.run()
.success()
.succeeds()
.stdout_is("test -E araba\n");
new_ucmd!()
@ -240,11 +238,20 @@ fn test_hyphen_values_between() {
.arg("dum dum dum")
.arg("-e")
.arg("dum")
.run()
.success()
.succeeds()
.stdout_is("dumdum dum dum dum -e dum\n");
}
#[test]
fn test_double_hyphens() {
new_ucmd!().arg("--").succeeds().stdout_only("--\n");
new_ucmd!()
.arg("--")
.arg("--")
.succeeds()
.stdout_only("-- --\n");
}
#[test]
fn wrapping_octal() {
// Some odd behavior of GNU. Values of \0400 and greater do not fit in the