summary refs log tree commit diff
path: root/tests/readers
diff options
context:
space:
mode:
authorLudovic Courtès2012-02-08 00:29:20 +0100
committerLudovic Courtès2012-02-08 00:29:20 +0100
commitc6f93afa1665b2f000c812bc028b78043c5231de (patch)
tree1f90097d5c7d35b619c4dd8360086b462d81c960 /tests/readers
parent604afa2a5a254f2f83cddf7995f1babc8804d481 (diff)
downloadskribilo-c6f93afa1665b2f000c812bc028b78043c5231de.tar.gz
skribilo-c6f93afa1665b2f000c812bc028b78043c5231de.tar.lz
skribilo-c6f93afa1665b2f000c812bc028b78043c5231de.zip
tests: Use `syntax-rules' in `rss-2.test'.
* tests/readers/rss-2.test (test-match): Rewrite using `syntax-rules'.
Diffstat (limited to 'tests/readers')
-rw-r--r--tests/readers/rss-2.test19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/readers/rss-2.test b/tests/readers/rss-2.test
index 53e2b8c..64eccea 100644
--- a/tests/readers/rss-2.test
+++ b/tests/readers/rss-2.test
@@ -1,6 +1,6 @@
 ;;; Excercise RSS 2.0 reader.                  -*- Scheme -*-
 ;;;
-;;; Copyright (C) 2008, 2009  Ludovic Courtès <ludo@gnu.org>
+;;; Copyright (C) 2008, 2009, 2012  Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of Skribilo.
 ;;;
@@ -20,7 +20,8 @@
 (define-module (tests rss-2)
   :use-module (ice-9 match)
   :use-module (skribilo reader)
-  :use-module (srfi srfi-64))
+  :use-module (srfi srfi-64)
+  :use-module (ice-9 syncase))
 
 (if (or (not (false-if-exception (resolve-interface '(sxml simple))))
         (not (false-if-exception (resolve-interface '(htmlprag)))))
@@ -29,12 +30,14 @@
 (define %rss2-read #f)
 
 
-(define-macro (test-match name pattern xml)
-  ;; Test whether the RSS feed in XML matches PATTERN.
-  `(test-equal ,name #t
-     (match (%rss2-read (open-input-string ,xml))
-       (,pattern #t)
-       (_        #f))))
+(define-syntax test-match
+  (syntax-rules ()
+    ((_ name pattern xml)
+     ;; Test whether the RSS feed in XML matches PATTERN.
+     (test-assert name
+       (match (%rss2-read (open-input-string xml))
+         (pattern #t)
+         (_       #f))))))