diff --git a/private/file-utils.rkt b/private/file-utils.rkt index c85da2f..e24c71d 100644 --- a/private/file-utils.rkt +++ b/private/file-utils.rkt @@ -1,17 +1,14 @@ #lang racket/base (provide ->relative ->absolute) -(require racket/list) +(require racket/list racket/path) (module+ test (require rackunit)) ;; PathString -> Path (define (->relative path) - (simplify-path - (if (relative-path? path) - (build-path path) - (let-values ([(_ lst) - (split-at (explode-path path) - (length (explode-path (current-directory))))]) - (apply build-path lst))))) + (build-path + (find-relative-path + (current-directory) + path))) (module+ test (parameterize ([current-directory (build-path "/test")]) diff --git a/raco.rkt b/raco.rkt index 43bd700..57052ed 100644 --- a/raco.rkt +++ b/raco.rkt @@ -229,7 +229,7 @@ paths)) (module+ test - (parameterize ([current-directory (build-path "/tests")]) + (parameterize ([current-directory (build-path "/test")]) (check-not-false (is-excluded-path? "/test/test/x.rkt" '("test"))) (check-false (is-excluded-path? "/test/x.rkt" '("test"))) (check-false (is-excluded-path? "/test/t/x.rkt" '("test")))))