|
47 | 47 | (provide 'srfi-64)
|
48 | 48 | (provide 'testing)
|
49 | 49 | (require 'srfi-35))
|
| 50 | + (gauche |
| 51 | + (define-module srfi-64) |
| 52 | + (select-module srfi-64)) |
50 | 53 | (else
|
51 | 54 | ))
|
52 | 55 |
|
|
62 | 65 | (syntax-rules ()
|
63 | 66 | ((%test-export test-begin . other-names)
|
64 | 67 | (module-export %test-begin test-begin . other-names)))))
|
| 68 | + (gauche |
| 69 | + (define-syntax %test-export export)) |
65 | 70 | (else
|
66 | 71 | (define-syntax %test-export
|
67 | 72 | (syntax-rules ()
|
|
921 | 926 | (test-result-alist! r '())
|
922 | 927 | (%test-error r #t expr)))))))
|
923 | 928 |
|
| 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 | + |
924 | 938 | (define (test-apply first . rest)
|
925 | 939 | (if (test-runner? first)
|
926 | 940 | (test-with-runner first (apply test-apply rest))
|
|
940 | 954 | (test-with-runner r (apply test-apply first rest))
|
941 | 955 | ((test-runner-on-final r) r))))))
|
942 | 956 |
|
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 |
| - |
952 | 957 | ;;; Predicates
|
953 | 958 |
|
954 | 959 | (define (%test-match-nth n count)
|
|
1030 | 1035 | (if (eof-object? (read-char port))
|
1031 | 1036 | (cond-expand
|
1032 | 1037 | (guile (eval form (current-module)))
|
| 1038 | + (gauche (eval form ((with-module gauche.internal vm-current-module)))) |
1033 | 1039 | (else (eval form)))
|
1034 | 1040 | (cond-expand
|
1035 | 1041 | (srfi-23 (error "(not at eof)"))
|
|
0 commit comments