Skip to content

Commit da7e54b

Browse files
Merge pull request #1 from shirok/gauche
Macro definition order fix and Gauche support
2 parents 09d497d + fd9a5d6 commit da7e54b

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

testing.scm

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
(provide 'srfi-64)
4848
(provide 'testing)
4949
(require 'srfi-35))
50+
(gauche
51+
(define-module srfi-64)
52+
(select-module srfi-64))
5053
(else
5154
))
5255

@@ -62,6 +65,8 @@
6265
(syntax-rules ()
6366
((%test-export test-begin . other-names)
6467
(module-export %test-begin test-begin . other-names)))))
68+
(gauche
69+
(define-syntax %test-export export))
6570
(else
6671
(define-syntax %test-export
6772
(syntax-rules ()
@@ -921,6 +926,15 @@
921926
(test-result-alist! r '())
922927
(%test-error r #t expr)))))))
923928

929+
(define-syntax test-with-runner
930+
(syntax-rules ()
931+
((test-with-runner runner form ...)
932+
(let ((saved-runner (test-runner-current)))
933+
(dynamic-wind
934+
(lambda () (test-runner-current runner))
935+
(lambda () form ...)
936+
(lambda () (test-runner-current saved-runner)))))))
937+
924938
(define (test-apply first . rest)
925939
(if (test-runner? first)
926940
(test-with-runner first (apply test-apply rest))
@@ -940,15 +954,6 @@
940954
(test-with-runner r (apply test-apply first rest))
941955
((test-runner-on-final r) r))))))
942956

943-
(define-syntax test-with-runner
944-
(syntax-rules ()
945-
((test-with-runner runner form ...)
946-
(let ((saved-runner (test-runner-current)))
947-
(dynamic-wind
948-
(lambda () (test-runner-current runner))
949-
(lambda () form ...)
950-
(lambda () (test-runner-current saved-runner)))))))
951-
952957
;;; Predicates
953958

954959
(define (%test-match-nth n count)
@@ -1030,6 +1035,7 @@
10301035
(if (eof-object? (read-char port))
10311036
(cond-expand
10321037
(guile (eval form (current-module)))
1038+
(gauche (eval form ((with-module gauche.internal vm-current-module))))
10331039
(else (eval form)))
10341040
(cond-expand
10351041
(srfi-23 (error "(not at eof)"))

0 commit comments

Comments
 (0)