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

(string-index): Exercise 8-bit char in string.

This commit is contained in:
Kevin Ryde 2005-03-25 20:58:22 +00:00
parent f12de0a178
commit 59216e48da

View file

@ -1,7 +1,7 @@
;;;; srfi-13.test --- Test suite for Guile's SRFI-13 functions. -*- scheme -*-
;;;; Martin Grabmueller, 2001-05-07
;;;;
;;;; Copyright (C) 2001, 2004 Free Software Foundation, Inc.
;;;; Copyright (C) 2001, 2004, 2005 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
@ -755,7 +755,15 @@
(= 1 (string-index "foo bar" char-alphabetic? 1 6)))
(pass-if "non-empty - pred - no match - start and end index"
(not (string-index "frobnicate" char-numeric? 2 5))))
(not (string-index "frobnicate" char-numeric? 2 5)))
;; in guile 1.6.7 and earlier this resulted in a segv, because
;; SCM_MAKE_CHAR didn't cope with "signed char" arguments containing an
;; 8-bit value
(pass-if "8-bit char in string"
(begin
(string-index (string (integer->char 200)) char-numeric?)
#t)))
(with-test-prefix "string-index-right"