diff --git a/test-suite/tests/srfi-13.test b/test-suite/tests/srfi-13.test index ce0240e92..89759d0d3 100644 --- a/test-suite/tests/srfi-13.test +++ b/test-suite/tests/srfi-13.test @@ -18,11 +18,20 @@ ;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;;;; Boston, MA 02110-1301 USA -(use-modules (srfi srfi-13) (srfi srfi-14) (test-suite lib)) +(define-module (test-strings) + #:use-module (test-suite lib) + #:use-module (srfi srfi-13) + #:use-module (srfi srfi-14)) + (define exception:strict-infix-grammar (cons 'misc-error "^strict-infix")) +;; Create a string from integer char values, eg. (string-ints 65) => "A" +(define (string-ints . args) + (apply string (map integer->char args))) + + ;;; ;;; string-any ;;; @@ -185,6 +194,32 @@ (pass-if (equal? "abc" (string-concatenate '("a" "b" "c"))))) +;; +;; string-compare +;; + +(with-test-prefix "string-compare" + + (pass-if "same as charchar 0) (integer->char 255)) + (string-compare (string-ints 0) (string-ints 255) + (lambda (pos) #t) ;; lt + (lambda (pos) #f) ;; eq + (lambda (pos) #f))))) ;; gt + +;; +;; string-compare-ci +;; + +(with-test-prefix "string-compare-ci" + + (pass-if "same as char-cichar 0) (integer->char 255)) + (string-compare-ci (string-ints 0) (string-ints 255) + (lambda (pos) #t) ;; lt + (lambda (pos) #f) ;; eq + (lambda (pos) #f))))) ;; gt + ;;; ;;; string-concatenate/shared ;;;