[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] R7RS test suite?

For Kawa I'm working my way through r7rs-test.scm
from chibi-scheme-0.6.1.  Is this the best/recommended
"standard" R7RS test suite?

It's (mostly) easy enough to skip tests that don't work
on Kawa.  (I mark them as "expected failures".)
However, there some issues with the testsuite itself,
in that it seems insufficiently robust and portable.

Some expressions return inexact real results, and
these are being compared with equals, which is non-portable.
I suggest using something like SRFI-64's test-approximate.

Some places expect an exact result, when that is not required
by the standard.  For example:
(test 30 ((compose sqrt *) 12 75))
Such tests could also use test-approximate:
(test-approximate 30 ((compose sqrt *) 12 75) 0.0001)

Having test-numeric-syntaxes take a long list of tests makes it
more difficult to deal with individual tests, in terms of
debugging or marking them as expected failures.
Instead of:
  ("1" 1)
  ("#i1.0+1.0i" (make-rectangular 1.0 1.0) "1.0+1.0i" "1.+1.i")
it would be better to write them as separate tests:
(test-numeric-syntax "1" 1)
(test-numeric-syntax "#i1.0+1.0i" (make-rectangular 1.0 1.0) "1.0+1.0i" 

Some of the test-numeric-syntaxes tests use "non-default"
exponent-markers.  Some implementations have different markers
return different floating-point precisions or representations,
so again comparing them with equal? is problematic.
	--Per Bothner
per@x   http://per.bothner.com/

Scheme-reports mailing list