mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
(string-index): Exercise 8-bit char in string.
This commit is contained in:
parent
1db3c9000f
commit
3c812ec1db
1 changed files with 10 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
;;;; srfi-13.test --- Test suite for Guile's SRFI-13 functions. -*- scheme -*-
|
;;;; srfi-13.test --- Test suite for Guile's SRFI-13 functions. -*- scheme -*-
|
||||||
;;;; Martin Grabmueller, 2001-05-07
|
;;;; 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
|
;;;; 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
|
;;;; it under the terms of the GNU General Public License as published by
|
||||||
|
@ -772,7 +772,15 @@
|
||||||
(= 1 (string-index "foo bar" char-alphabetic? 1 6)))
|
(= 1 (string-index "foo bar" char-alphabetic? 1 6)))
|
||||||
|
|
||||||
(pass-if "non-empty - pred - no match - start and end index"
|
(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"
|
(with-test-prefix "string-index-right"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue