summaryrefslogtreecommitdiffstats
path: root/tests/by-util
diff options
context:
space:
mode:
authorChristian von Elm <cvonelm@cvonelm.de>2024-06-30 14:17:13 +0200
committerChristian von Elm <cvonelm@cvonelm.de>2024-06-30 14:24:00 +0200
commit866366a8748912d76398c083f206ca21c5f0e254 (patch)
treeed8812d2b5992407d4da9372c38585f7858ba07f /tests/by-util
parentcb5111c1b826010a90067c675654f2ec11f9d377 (diff)
tr: correctly detected matched [:upper:]
tr detects if a class in set2 is matched by a class at the correct position in set1 after it has expanded everything before the class in both sets: So tr 'abcd[:upper:]' 'a-d[:lower:]' should not fail
Diffstat (limited to 'tests/by-util')
-rw-r--r--tests/by-util/test_tr.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/by-util/test_tr.rs b/tests/by-util/test_tr.rs
index 4179e21fb..8fe6aab00 100644
--- a/tests/by-util/test_tr.rs
+++ b/tests/by-util/test_tr.rs
@@ -1376,6 +1376,13 @@ fn check_class_in_set2_must_be_matched_in_set1() {
}
#[test]
+fn check_class_in_set2_must_be_matched_in_set1_right_length_check() {
+ new_ucmd!()
+ .args(&["-t", "a-z[:upper:]", "abcdefghijklmnopqrstuvwxyz[:upper:]"])
+ .succeeds();
+}
+
+#[test]
fn check_set1_longer_set2_ends_in_class() {
new_ucmd!().args(&["[:lower:]a", "[:upper:]"]).fails();
}