From: Sunjoong Lee <sunjoong@gmail.com>
To: guile-user@gnu.org
Subject: SRFI-64 module and SRFI-78 module -- archive file attached
Date: Thu, 26 Apr 2012 17:27:48 +0900 [thread overview]
Message-ID: <CAK93xho3cVcXZe0o9_PeLXx1DdvcYt-oEzMmvTBVqpKJMBUpyQ@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1510 bytes --]
Hello,
I've attatched a file archiving modules of my recent version of SRFI-64
implementation and SRFI-78.
SRFI-64 is "A Scheme API for test suites."
SRFI-78 is "Lightweight testing."
If you want to test your code, there are 5 options; using SRFI-64, SRFI-78,
unit-test of guile-lib, lib of test-suite in Guile source archive or your
own test suite. Here is four examples:
;;; filename: srfi-64-example.scm
(use-modules (srfi srfi-64))
(test-begin "vec-test")
(define v (make-vector 5 99))
(test-assert (vector? v))
(test-eqv 99 (vector-ref v 2))
(vector-set! v 2 7)
(test-eqv 7 (vector-ref v 2))
(test-end "vec-test")
;;; filename: srfi-78-example.scm
(use-modules (srfi srfi-78))
(define v (make-vector 5 99))
(check (vector? v) => #t)
(check (vector-ref v 2) => 99)
(vector-set! v 2 7)
(check (vector-ref v 2) => 7)
;;; filename: unit-test-example.scm
(use-modules (unit-test) (oop goops))
(define v (make-vector 5 99))
(define-class <vec-test> (<test-case>))
(define-method (test-vector? (self <vec-test>))
(assert-true (vector? v)))
(define-method (test-99 (self <vec-test>))
(assert-equal 99 (vector-ref v 2)))
(define-method (test-7 (self <vec-test>))
(vector-set! v 2 7)
(assert-equal 7 (vector-ref v 2)))
(exit-with-summary (run-all-defined-test-cases))
;;; filename: test-suite-example.scm
(use-modules (test-suite lib))
(define v (make-vector 5 99))
(pass-if "vector?" (vector? v))
(pass-if "99" (eqv? 99 (vector-ref v 2)))
(vector-set! v 2 7)
(pass-if "7" (eqv? 7 (vector-ref v 2)))
[-- Attachment #1.2: Type: text/html, Size: 2230 bytes --]
[-- Attachment #2: srfi-64_and_srfi-78.tar.gz --]
[-- Type: application/x-gzip, Size: 11829 bytes --]
next reply other threads:[~2012-04-26 8:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 8:27 Sunjoong Lee [this message]
2012-05-03 6:45 ` SRFI-64 module and SRFI-78 module -- archive file attached Sunjoong Lee
2012-05-14 14:07 ` Sunjoong Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAK93xho3cVcXZe0o9_PeLXx1DdvcYt-oEzMmvTBVqpKJMBUpyQ@mail.gmail.com \
--to=sunjoong@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).