Skip to content

Commit e49e55e

Browse files
committed
test: allow +1 scrbl and test files
1 parent 0e0f34e commit e49e55e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test.rkt

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
(define (filter/rx rx v*)
2424
(filter (λ (v) (regexp-match? rx v)) v*))
2525

26+
(define (<=1 n)
27+
(<= 1 n))
28+
2629
(for ((d (in-glob "*/")))
2730
(cond
2831
[(compiled-dir? d)
@@ -39,11 +42,11 @@
3942
(path->string (file-name-from-path ps))))
4043
(define scrbl*
4144
(let ([f* (filter/rx #rx"\\.scrbl$" file*)])
42-
(check-equal? (length f*) 1 (format "directory '~a' must contains one Scribble file" d))
45+
(check-pred <=1 (length f*) (format "directory '~a' must contain at least one Scribble file" d))
4346
f*))
4447
(define test*
4548
(let ([f* (filter/rx #rx"-test\\.rkt$" file*)])
46-
(check-equal? (length f*) 1 (format "directory '~a' must contains one '-test.rkt' file" d))
49+
(check-pred <=1 (length f*) (format "directory '~a' must contain at least one '-test.rkt' file" d))
4750
f*))
4851
(define scrbl-name (cadr (regexp-match #rx"^([^.]*)\\.scrbl$" (car scrbl*))))
4952
(define test-name (cadr (regexp-match #rx"^([^.]*)-test\\.rkt$" (car test*))))

0 commit comments

Comments
 (0)