1(cond-expand
2 (kawa
3  ;; Using 3-operand datum->syntax enables line numbers in reporting.
4  (define-syntax xtest
5    (lambda (form)
6      (syntax-case form ()
7        ;; We need to use the rest1 and rest2 variables since the Kawa reader
8        ;; currently only attaches line-numbers to pairs, and the quoted and
9        ;; evaluated sub-forms aren't guaranteed to be lists.
10        ((strtest value . rest1)
11         (syntax-case #'rest1 ()
12           ((quoted . rest2)
13            (syntax-case #'rest2 ()
14              ((evaluated)
15               #`(begin
16             #,(datum->syntax form #'(test-equal quoted (quote value))
17                              #'rest1)
18             #,(datum->syntax form #'(test-equal evaluated (format "~a" value))
19                              #'rest2)))))))))))
20 (else
21  (define-syntax xtest
22    (syntax-rules ()
23      ((xtest value quoted evaluated)
24       (begin
25         (test-equal quoted (quote value))
26         (test-equal evaluated (format "~w" value))))))))
27