Daniel Llorens <[email protected]> writes: > SRFI-64 has all these specific binary predicates: test-eqv, > test-equal, test-eq, test-approximate, but no way to pass your own > predicate, which is annoying. Please correct me if I'm wrong. > > An extension to be able to pass your own predicate may be more > generally useful.
You can use `test-assert': (test-assert (my-equal? foo bar)) While we're on the topic, random remark on the SRFI-64 reference implementation which Guile also uses: I'm working on it as part of my R7RS SRFIs project[0] right now, and in some ways it's broken and doesn't conform to its own specification. The spec says that the default "simple" test runner logs to standard output only, when the reference implementation has it write to a log file. `test-assert' doesn't evaluate its test-name argument on some Scheme platforms (on Guile it's fine), and some `test-foo' forms evaluate their test-name argument twice due to a typo in the code... Overall the code is quite dirty so be wary of bugs. I'm cleaning up and fixing the code on my repo as I go, while retaining the `cond-expand' stuff for extra functionality on platforms supporting it (most notably line number reporting), but I already ditched the file logging (i.e. a significant behavioral change) so I don't know if Guile will want to adopt it. A Guile-specific from-scratch rewrite might not be a bad idea if anyone's interested. [0] https://gitorious.org/taylan-scheme/srfi/ Taylan
