a port of SchemeUnit assert-base to SISC
Andrew Wilcox <schematics-dev-1nkB91yrSd/a/[email protected]> Fri, 29 Apr 2005 07:46:53 -0700 (PDT)
| Newsgroups | gmane.lisp.scheme.plt.schematics |
|---|---|
| Message-ID | <[email protected]> |
I've completed an initial port of SchemeUnit's assert-base.ss to SISC.
I used Scott Miller's suggestion to try SRFI-35 Conditions, which SISC
supports, to implement the hierarchy of test exceptions.
One question was whether to keep the MzScheme style exception names
(exn:test, exn:test:assertion, etc.) or use names in the style of
SRFI-35. My choice was to use names in the style of SRFI-35, since
they are no longer MzScheme exceptions, and the exception names are
not part of the public API of SchemeUnit. However this could easily
be changed.
This code requires a fix to SISC's srfi-35.scm. Matthias Radestock
recently checked this fix into SISC's CVS tree, but it is not yet
available in a SISC release.
--- orig/src/sisc/libs/srfi/srfi-35.scm
+++ mod/src/sisc/libs/srfi/srfi-35.scm
@@ -15,8 +15,12 @@
(condition type-field-alist->condition)
&condition
&message
+ message-condition?
+ condition-message
&serious
- &error)
+ serious-condition?
+ &error
+ error?)
(import srfi-1)
(import srfi-9)
(import srfi-23)
I spent some time looking at whether it would be possible to have a
single code base for both the MzScheme and SISC ports of SchemeUnit.
(I'm interested in this question because I want to be able to do this
for my own code as well). I made some progress in this direction.
However, I realized that assert-base would need to be split into
pieces to work with SISC, and to do that and write code that would
work in both MzScheme and SISC was too much to tackle at the same
time. This code thus is a straightforward conversion to SISC, without
any attempt to remain compatible with MzScheme.
I included some "poor man's" unit tests to check a couple things in
the implementation of assert-base. Since the SchemeUnit framework
isn't up and running yet, these unit tests simply throw an error if an
assertion fails.
The code can be browsed here:
http://code.andrewwilcox.name/browse/code-1nkB91yrSd/a/[email protected]/dev/dev--a/dev--a--0/dev--a--0--patch-24/src/schemeunit/
And is available within a GNU Arch project named
code-1nkB91yrSd/a/[email protected]/dev--a--0
inside the src/schemeunit directory.
This archive is published at:
http://code.andrewwilcox.name/2005
and may be accessed from GNU Arch with commands such as:
tla register-archive http://code.andrewwilcox.name/2005
tla get code-1nkB91yrSd/a/[email protected]/dev--a--0
Andrew Wilcox
-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix