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

* Added some syntax tests for numbers.

This commit is contained in:
Dirk Herrmann 2001-08-11 16:59:42 +00:00
parent 284774f38d
commit 2f4a254ac9
2 changed files with 24 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2001-08-11 Dirk Herrmann <D.Herrmann@tu-bs.de>
* tests/numbers.test: Added Some syntax tests for
string->number.
2001-08-09 Marius Vollmer <marius.vollmer@uni-dortmund.de>
* Makefile.am (TESTS): Do not call the variable "TESTS", call it

View file

@ -850,6 +850,25 @@
;;; string->number
;;;
(with-test-prefix "string->number"
(pass-if "string->number"
(documented? string->number))
(pass-if "non number strings"
(for-each (lambda (x) (if (string->number x) (throw 'fail)))
'("" "q" "1q" "6+7iq" "8+9q" "10+11" "13+" "18@19 " "20@q" "23@"
"+25iq" "26i" "-q" "-iq" "i" "5#.0" "8/" "10#11" ".#" "."
"#o.2" "3.4q" "15.16e17q" "18.19e+q" ".a" ".17#18" "10q" "#b2"
"#b3" "#b4" "#b5" "#b6" "#b7" "#b8" "#b9" "#ba" "#bb" "#bc"
"#bd" "#be" "#bf" "#q" "#b#b1" "#o#o1" "#d#d1" "#x#x1" "#e#e1"
"#i#i1" "12@12+0i"))
#t)
(pass-if-exception "exponent too big"
exception:out-of-range
(string->number "12.13e141414")))
;;;
;;; number?
;;;