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

stty: add ispeed/ospeed settings (#8180)

* stty: add ispeed/ospeed settings

* stty: fix spell check errors
This commit is contained in:
Will Shuttleworth 2025-06-15 10:46:54 -04:00 committed by GitHub
parent 98e3852b40
commit 6023888363
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 83 additions and 6 deletions

View file

@ -2,7 +2,7 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore parenb parmrk ixany iuclc onlcr ofdel icanon noflsh econl igpar
// spell-checker:ignore parenb parmrk ixany iuclc onlcr ofdel icanon noflsh econl igpar ispeed ospeed
use uutests::new_ucmd;
use uutests::util::TestScenario;
@ -110,3 +110,60 @@ fn invalid_setting() {
.fails()
.stderr_contains("invalid argument 'igpar'");
}
#[test]
fn invalid_baud_setting() {
#[cfg(not(any(
target_os = "freebsd",
target_os = "dragonfly",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
)))]
new_ucmd!()
.args(&["100"])
.fails()
.stderr_contains("invalid argument '100'");
new_ucmd!()
.args(&["-1"])
.fails()
.stderr_contains("invalid argument '-1'");
new_ucmd!()
.args(&["ispeed"])
.fails()
.stderr_contains("missing argument to 'ispeed'");
new_ucmd!()
.args(&["ospeed"])
.fails()
.stderr_contains("missing argument to 'ospeed'");
#[cfg(not(any(
target_os = "freebsd",
target_os = "dragonfly",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
)))]
new_ucmd!()
.args(&["ispeed", "995"])
.fails()
.stderr_contains("invalid ispeed '995'");
#[cfg(not(any(
target_os = "freebsd",
target_os = "dragonfly",
target_os = "ios",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
)))]
new_ucmd!()
.args(&["ospeed", "995"])
.fails()
.stderr_contains("invalid ospeed '995'");
}