diff options
author | Mark H Weaver <mhw@netris.org> | 2014-01-12 04:36:02 -0500 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-01-14 02:24:24 -0500 |
commit | 7a329029cf898fc0b9b24252c9bb437e1ad0b1d7 (patch) | |
tree | 24a0298953a4ff3c16c0c102d06eb451bbc33c43 /test-suite/tests | |
parent | 61d509194c6ce90e678a0b27d613f3656c8bbafd (diff) | |
download | guile-7a329029cf898fc0b9b24252c9bb437e1ad0b1d7.tar.gz |
read: Support R7RS '#true' and '#false' syntax for booleans.
* libguile/read.c (try_read_ci_chars): New static function.
(scm_read_boolean, scm_read_array): Use 'try_read_ci_chars'.
* doc/ref/api-data.texi (Booleans): Update docs.
* test-suite/tests/reader.test ("reading"): Add tests.
Diffstat (limited to 'test-suite/tests')
-rw-r--r-- | test-suite/tests/reader.test | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test-suite/tests/reader.test b/test-suite/tests/reader.test index 6e02255ad..448ae1bcb 100644 --- a/test-suite/tests/reader.test +++ b/test-suite/tests/reader.test @@ -1,6 +1,7 @@ ;;;; reader.test --- Reader test. -*- coding: iso-8859-1; mode: scheme -*- ;;;; -;;;; Copyright (C) 1999, 2001, 2002, 2003, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;;;; Copyright (C) 1999, 2001, 2002, 2003, 2007, 2008, 2009, 2010, 2011, +;;;; 2014 Free Software Foundation, Inc. ;;;; Jim Blandy <jimb@red-bean.com> ;;;; ;;;; This library is free software; you can redistribute it and/or @@ -73,6 +74,14 @@ (not (equal? (imag-part (read-string "-nan.0-1i")) (imag-part (read-string "-nan.0+1i"))))) + (pass-if-equal "#true" + '(a #t b) + (read-string "(a #true b)")) + + (pass-if-equal "#false" + '(a #f b) + (read-string "(a #false b)")) + ;; At one time the arg list for "Unknown # object: ~S" didn't make it out ;; of read.c. Check that `format' can be applied to this error. (pass-if "error message on bad #" |