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

stty: set control characters (#7931)

* reworked arg processing. control character mappings are correctly grouped now, ie 'stty erase ^H'

* stty: setting control chars to undefined (disabling them) is implemented

* setting control chars

* stty: can now set control chars. need to improve checks on valid mappings

* stty: matches GNU in what control character mappings are allowed

* stty: run rustfmt and remove extra comments

* stty: setting control char code review fixes

* stty: fix rustfmt errors

* stty: more small edits after review

* stty: refactor set control char changes for better testing

* stty: fix ci error

* stty: fix issues from code review
This commit is contained in:
Will Shuttleworth 2025-06-05 09:38:51 +00:00 committed by GitHub
parent ccc6233fba
commit 61bd11a551
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 266 additions and 64 deletions

View file

@ -64,3 +64,36 @@ fn save_and_all() {
"the options for verbose and stty-readable output styles are mutually exclusive",
);
}
#[test]
fn no_mapping() {
new_ucmd!()
.args(&["intr"])
.fails()
.stderr_contains("missing argument to 'intr'");
}
#[test]
fn invalid_mapping() {
new_ucmd!()
.args(&["intr", "cc"])
.fails()
.stderr_contains("invalid integer argument: 'cc'");
new_ucmd!()
.args(&["intr", "256"])
.fails()
.stderr_contains("invalid integer argument: '256': Value too large for defined data type");
new_ucmd!()
.args(&["intr", "0x100"])
.fails()
.stderr_contains(
"invalid integer argument: '0x100': Value too large for defined data type",
);
new_ucmd!()
.args(&["intr", "0400"])
.fails()
.stderr_contains("invalid integer argument: '0400': Value too large for defined data type");
}