mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tr: fix order inside class [:blank:]
This commit is contained in:
parent
76a2f2128b
commit
e9045be593
2 changed files with 15 additions and 1 deletions
|
@ -12,4 +12,4 @@ pub static FF: u8 = 0xC;
|
|||
pub static CR: u8 = 0xD;
|
||||
pub static SPACE: u8 = 0x20;
|
||||
pub static SPACES: &[u8] = &[HT, LF, VT, FF, CR, SPACE];
|
||||
pub static BLANK: &[u8] = &[SPACE, HT];
|
||||
pub static BLANK: &[u8] = &[HT, SPACE];
|
||||
|
|
|
@ -1299,3 +1299,17 @@ fn check_regression_class_space() {
|
|||
.no_stderr()
|
||||
.stdout_only("a123456b");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn check_regression_class_blank() {
|
||||
// This invocation checks:
|
||||
// 1. that the [:blank:] class has exactly 2 characters,
|
||||
// 2. that the [:blank:] class contains at least the given 2 characters (and therefore no other characters), and
|
||||
// 3. that the given characters occur in exactly this order.
|
||||
new_ucmd!()
|
||||
.args(&["[:blank:][:upper:]", "12[:lower:]"])
|
||||
.pipe_in("A\t B")
|
||||
.succeeds()
|
||||
.no_stderr()
|
||||
.stdout_only("a12b");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue