From b86fd6ae6b979ebe1733a1fa37ae94f95abbc7c9 Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Sun, 30 Aug 2015 13:20:43 -0500 Subject: [PATCH] fixing test path coverage --- cover/raco.rkt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cover/raco.rkt b/cover/raco.rkt index ea15525..4752a84 100644 --- a/cover/raco.rkt +++ b/cover/raco.rkt @@ -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")))