1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-05 06:50:21 +02:00

(string-map): Swapped order of string and

proc args to conform with the srfi.  (Thanks to Alex Shinn.)
This commit is contained in:
Thien-Thi Nguyen 2001-08-23 19:07:30 +00:00
parent fd8a9f4b35
commit 2b33c2f28d

View file

@ -2,23 +2,23 @@
;;;; Martin Grabmueller, 2001-05-07
;;;;
;;;; Copyright (C) 2001 Free Software Foundation, Inc.
;;;;
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
;;;; the Free Software Foundation; either version 2, or (at your option)
;;;; any later version.
;;;;
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this software; see the file COPYING. If not, write to
;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
;;;; Boston, MA 02111-1307 USA
(use-modules (srfi srfi-13) (srfi srfi-14))
(use-modules (srfi srfi-13) (srfi srfi-14) (test-suite lib))
;;; This kludge is needed, because SRFI-13 redefines some bindings in
;;; the core.
@ -161,7 +161,7 @@
(string=? "bla|delim|fasel" (string-join '("bla" "fasel") "|delim|"
'infix)))
(pass-if-exception "empty list, strict infix"
(pass-if-exception "empty list, strict infix"
exception:strict-infix-grammar
(string-join '() "|delim|" 'strict-infix))
@ -1010,3 +1010,14 @@
(pass-if "pred, start and end index"
(string=? "" (string-delete ".foo.bar." char-alphabetic? 2 4))))
(with-test-prefix "string-map"
(pass-if "constant"
(string=? "xxx" (string-map (lambda (c) #\x) "foo")))
(pass-if "identity"
(string=? "foo" (string-map identity "foo")))
(pass-if "upcase"
(string=? "FOO" (string-map char-upcase "foo"))))