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:
parent
ccc6233fba
commit
61bd11a551
3 changed files with 266 additions and 64 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue