(string-index): Exercise 8-bit char in string.
authorKevin Ryde <user42@zip.com.au>
Fri, 25 Mar 2005 20:58:22 +0000 (20:58 +0000)
committerKevin Ryde <user42@zip.com.au>
Fri, 25 Mar 2005 20:58:22 +0000 (20:58 +0000)
test-suite/tests/srfi-13.test

index 372a467..666d3dc 100644 (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
     (= 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"