1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-24 04:15:36 +02:00

New function string-replace-substring in (ice-9 string-fun)

By A. Wingo in
https://lists.gnu.org/archive/html/guile-devel/2014-03/msg00058.html.

* module/ice-9/string-fun.scm (string-replace-substring): As stated.
* doc/ref/api-data.texi: Document the new function.
* test-suite/tests/strings.test: Test.
This commit is contained in:
Daniel Llorens 2020-01-06 09:44:01 +01:00
parent ddad8ae05a
commit 6cfee36543
3 changed files with 60 additions and 2 deletions

View file

@ -20,7 +20,8 @@
(define-module (test-strings)
#:use-module ((system base compile) #:select (compile))
#:use-module (test-suite lib))
#:use-module (test-suite lib)
#:use-module (ice-9 string-fun))
(define exception:read-only-string
(cons 'misc-error "^string is read-only"))
@ -693,3 +694,9 @@
(string-upcase! (substring/shared str2 1 4))
(and (string=? str1 "foofoofoo")
(string=? str2 "oFOOf")))))
(with-test-prefix "miscellaneous string functions"
(pass-if "string-replace-substring"
(string=? (string-replace-substring "a ring of strings" "ring" "rut")
"a rut of struts")))