aboutsummaryrefslogtreecommitdiff
path: root/tests/basename.test
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-04-04 18:13:51 -0500
committerRob Landley <rob@landley.net>2017-04-04 18:13:51 -0500
commit216e4dab193458ba396db861a5eb6d410f80d1c8 (patch)
tree54f96586d3c58824eeee4d49df6e0343b26c3c5c /tests/basename.test
parenta456c2fc6b219d29294aa54c41fdad141b1d4254 (diff)
downloadtoybox-216e4dab193458ba396db861a5eb6d410f80d1c8.tar.gz
Add "testcmd" function as an alternative to "testing" for tests/*.test, and
check in two converted commands.
Diffstat (limited to 'tests/basename.test')
-rwxr-xr-xtests/basename.test18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/basename.test b/tests/basename.test
index ab2cc20a..25e5493f 100755
--- a/tests/basename.test
+++ b/tests/basename.test
@@ -5,22 +5,22 @@
#testing "name" "command" "result" "infile" "stdin"
# Removal of extra /'s
-testing "/-only" "basename ///////" "/\n" "" ""
-testing "trailing /" "basename a//////" "a\n" "" ""
-testing "combined" "basename /////a///b///c///d/////" "d\n" "" ""
+testcmd "/-only" "///////" "/\n" "" ""
+testcmd "trailing /" "a//////" "a\n" "" ""
+testcmd "combined" "/////a///b///c///d/////" "d\n" "" ""
# Standard suffix behavior.
-testing "suffix" "basename a/b/c/d.suffix .suffix" "d\n" "" ""
+testcmd "suffix" "a/b/c/d.suffix .suffix" "d\n" "" ""
# A suffix cannot be the entire result.
-testing "suffix=result" "basename .txt .txt" ".txt\n" "" ""
+testcmd "suffix=result" ".txt .txt" ".txt\n" "" ""
# Deal with suffix appearing in the filename
-testing "reappearing suffix 1" "basename a.txt.txt .txt" "a.txt\n" "" ""
-testing "reappearing suffix 2" "basename a.txt.old .txt" "a.txt.old\n" "" ""
+testcmd "reappearing suffix 1" "a.txt.txt .txt" "a.txt\n" "" ""
+testcmd "reappearing suffix 2" "a.txt.old .txt" "a.txt.old\n" "" ""
# A suffix should be a real suffix, only a the end.
-testing "invalid suffix" "basename isthisasuffix? suffix" "isthisasuffix?\n" "" ""
+testcmd "invalid suffix" "isthisasuffix? suffix" "isthisasuffix?\n" "" ""
# Zero-length suffix
-testing "zero-length suffix" "basename a/b/c ''" "c\n" "" ""
+testcmd "zero-length suffix" "a/b/c ''" "c\n" "" ""