From fd2c4707a675173aef1a0223e0cc0e77e5ce1df1 Mon Sep 17 00:00:00 2001 From: Spencer Florence Date: Sun, 5 Apr 2015 16:37:00 -0400 Subject: [PATCH] closes #48 --- private/file-utils.rkt | 13 +++++-------- raco.rkt | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) 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")))))