1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

(string-append/shared): New tests.

This commit is contained in:
Kevin Ryde 2005-11-30 00:35:45 +00:00
parent efeac8aed0
commit 8a8ca420b1

View file

@ -124,6 +124,50 @@
(pass-if "more than one match, start and end index" (pass-if "more than one match, start and end index"
(string-any char-upper-case? "abCDE" 1 4)))) (string-any char-upper-case? "abCDE" 1 4))))
;;;
;;; string-append/shared
;;;
(with-test-prefix "string-append/shared"
(pass-if "no args"
(string=? "" (string-append/shared)))
(with-test-prefix "one arg"
(pass-if "empty"
(string=? "" (string-append/shared "")))
(pass-if "non-empty"
(string=? "xyz" (string-append/shared "xyz"))))
(with-test-prefix "two args"
(pass-if (string=? "" (string-append/shared "" "")))
(pass-if (string=? "xyz" (string-append/shared "xyz" "")))
(pass-if (string=? "xyz" (string-append/shared "" "xyz")))
(pass-if (string=? "abcxyz" (string-append/shared "abc" "xyz"))))
(with-test-prefix "three args"
(pass-if (string=? "" (string-append/shared "" "" "")))
(pass-if (string=? "xy" (string-append/shared "xy" "" "")))
(pass-if (string=? "xy" (string-append/shared "" "xy" "")))
(pass-if (string=? "abxy" (string-append/shared "ab" "xy" "")))
(pass-if (string=? "ab" (string-append/shared "" "" "ab")))
(pass-if (string=? "xyab" (string-append/shared "xy" "" "ab")))
(pass-if (string=? "xyab" (string-append/shared "" "xy" "ab")))
(pass-if (string=? "ghxyab" (string-append/shared "gh" "xy" "ab"))))
(with-test-prefix "four args"
(pass-if (string=? "" (string-append/shared "" "" "" "")))
(pass-if (string=? "xy" (string-append/shared "xy" "" "" "")))
(pass-if (string=? "xy" (string-append/shared "" "xy" "" "")))
(pass-if (string=? "xy" (string-append/shared "" "" "xy" "")))
(pass-if (string=? "xy" (string-append/shared "" "" "" "xy")))
(pass-if (string=? "abxy" (string-append/shared "ab" "xy" "" "")))
(pass-if (string=? "abxy" (string-append/shared "ab" "" "xy" "")))
(pass-if (string=? "abxy" (string-append/shared "ab" "" "" "xy")))
(pass-if (string=? "abxy" (string-append/shared "" "ab" "" "xy")))
(pass-if (string=? "abxy" (string-append/shared "" "" "ab" "xy")))))
;;; ;;;
;;; string-concatenate ;;; string-concatenate
;;; ;;;