Skip to content

Commit 3b6964e

Browse files
tr: perform some operations streaming
1 parent cd6b8f0 commit 3b6964e

File tree

2 files changed

+688
-155
lines changed

2 files changed

+688
-155
lines changed

text/tests/tr/mod.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,3 +563,34 @@ fn tr_octal_parsing_non_ambiguous() {
563563
"321 \\ \x53 \x50 \x02 \x01 \\ CB",
564564
);
565565
}
566+
567+
#[test]
568+
fn tr_equiv_class_and_other_deletions() {
569+
tr_test(&["-d", "4[=a=]2"], "1 3 A a 2 4", "1 3 A ");
570+
}
571+
572+
#[test]
573+
fn tr_string2_equiv_inappropriate() {
574+
tr_bad_arguments_failure_test(
575+
&["1", "[=a=]"],
576+
"tr: [=c=] expressions may not appear in string2 when translating\n",
577+
);
578+
}
579+
580+
#[test]
581+
fn tr_equivalence_class_low_priority() {
582+
const INPUT: &str = "aaa bbb ccc 123";
583+
const OUTPUT: &str = "YYY bbb ccc 123";
584+
585+
tr_test(&["[=a=]a", "XY"], INPUT, OUTPUT);
586+
587+
tr_test(&["a[=a=]", "XY"], INPUT, OUTPUT);
588+
}
589+
590+
#[test]
591+
fn tr_arguments_validation_error_message_format() {
592+
tr_bad_arguments_failure_test(
593+
&["a"],
594+
"tr: missing operand after ‘a’. Two strings must be given when translating.\n",
595+
);
596+
}

0 commit comments

Comments
 (0)