Fix 'string-copy!' to work properly with overlapping src/dest.
[bpt/guile.git] / test-suite / tests / encoding-iso88597.test
index 8c155d2..a577b2a 100644 (file)
@@ -1,29 +1,25 @@
-;;;; strings.test --- test suite for Guile's string functions    -*- mode: scheme; coding: iso-8859-7 -*-
+;;;; encoding-iso88697.test --- test suite for Guile's string encodings    -*- mode: scheme; coding: iso-8859-7 -*-
 ;;;;
-;;;; Copyright (C) 2009 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,
+;;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;;;
+;;;; This library is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
+;;;;
+;;;; This library 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., 51 Franklin Street, Fifth Floor,
-;;;; Boston, MA 02110-1301 USA
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;;;; Lesser General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 (define-module (test-strings)
   #:use-module (test-suite lib)
   #:use-module (srfi srfi-1))
 
-(define exception:conversion
-  (cons 'misc-error "^cannot convert to output locale"))
-
 ;; Create a string from integer char values, eg. (string-ints 65) => "A"
 (define (string-ints . args)
   (apply string (map integer->char args)))
 (with-test-prefix "string length"
 
   (pass-if "s1"
-          (eq? (string-length s1) 4))
+          (eqv? (string-length s1) 4))
   
   (pass-if "s2"
-          (eq? (string-length s2) 3))
+          (eqv? (string-length s2) 3))
   
   (pass-if "s3"
-          (eq? (string-length s3) 8))
+          (eqv? (string-length s3) 8))
   
   (pass-if "s4" 
-          (eq? (string-length s4) 3)))
+          (eqv? (string-length s4) 3)))
 
 (with-test-prefix "internal encoding"
 
   (pass-if "1"
           (let ((á 1)
                 (ñ 2))
-            (eq? (+ á ñ) 3))))
+            (eqv? (+ á ñ) 3))))
 
 (with-test-prefix "output errors"
 
   (pass-if-exception "char #x0400"
-                    exception:conversion
+                    exception:encoding-error
                     (let ((pt (open-output-string)))
                       (set-port-encoding! pt "ISO-8859-7")
                       (set-port-conversion-strategy! pt 'error)