fixing test path coverage

This commit is contained in:
Spencer Florence 2015-08-30 13:20:43 -05:00
parent 893b381fc4
commit b86fd6ae6b

View File

@ -251,8 +251,18 @@
;; path (listof absolute-paths) -> boolean
(define (should-omit? path omits)
(define epath (explode-path (->absolute path)))
(for/or ([o omits])
(regexp-match? o path)))
(if (regexp? o)
(regexp-match? o path)
(let ([eo (explode-path (->absolute o))])
(let loop ([eo eo] [ep epath])
(cond [(and (null? eo) (null? ep)) #t]
[(null? eo) #t]
[(null? ep) #f]
[(equal? (car eo) (car ep))
(loop (cdr eo) (cdr ep))]
[else #f]))))))
(module+ test
(check-true (should-omit? "/Test/t.rkt" '("/Test")))