diff --git a/test-suite/tests/srfi-13.test b/test-suite/tests/srfi-13.test index f0dd00f99..b135434e5 100644 --- a/test-suite/tests/srfi-13.test +++ b/test-suite/tests/srfi-13.test @@ -124,6 +124,50 @@ (pass-if "more than one match, start and end index" (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 ;;;