]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: ls --hyperlink: add more escaping test cases
authorPádraig Brady <P@draigBrady.com>
Tue, 2 Dec 2025 13:13:54 +0000 (13:13 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 2 Dec 2025 13:17:51 +0000 (13:17 +0000)
* tests/ls/hyperlink.sh: Add tests for anchors, colons,
utf8, and invalid utf8 characters.

tests/ls/hyperlink.sh

index 8ab112fd28c3b85e00969dba73560a69d701c4e2..7c4abd511e3d9859b91a90569f4ea18c64522580 100755 (executable)
@@ -23,6 +23,7 @@ print_ver_ ls
 encode() {
  printf '%s\n' \
   'sp%20ace' 'ques%3ftion' 'back%5cslash' 'encoded%253Fquestion' 'testdir' \
+  'an%23chor' 'utf8%c3%a1' 'invalidutf8%e9' 'col%3aon' \
   "$1" |
  sort -k1,1.1 -s | uniq -w1 -d
 }
@@ -43,7 +44,8 @@ mkdir testdir || framework_failure_
 (
 cd testdir
 ls_encoded "testdir" > ../exp.t || framework_failure_
-for f in 'back\slash' 'encoded%3Fquestion' 'ques?tion' 'sp ace'; do
+for f in 'an#chor' 'back\slash' 'col:on' 'encoded%3Fquestion' \
+         "$(printf 'invalidutf8\xe9')" 'ques?tion' 'sp ace' 'utf8á'; do
   touch "$f" || framework_failure_
   ls_encoded "$f" >> ../exp.t || framework_failure_
 done