On Sun, Sep 1, 2013 at 3:38 AM, Per Bothner <[email protected]> wrote:
> 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? > Yes, though that doesn't mean it can't be improved. 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. > The test suite is written using the (chibi test) module, which is written in portable R7RS. If both the result and expected value are inexact they are compared approximately by default. In the rare case you want to compare a specific inexact bit pattern you can use test-assert with =. Some places expect an exact result, when that is not required > by the standard. For example: > (test 30 ((compose sqrt *) 12 75)) > This is too strong a requirement, I'll make the test allow inexact results. This case (where the standard allows either an exact or inexact result) would be a good case to provide something like test-approximate. 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. > This was adapted largely as-is from Peter Bex's numeric test suite for R5RS, pruning a lot. Possibly I overlooked some tests that are no longer valid, please let me know if you find any. Converting to a single test-numeric-syntax macro would indeed be better. Patches welcome :) -- Alex
_______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
