From 346429df4c4dd3ab03ca7ee5d561bf148b035e1e Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 29 May 2006 18:13:33 +0000 Subject: [PATCH] Tests for different file:// parsing of URLs svn: r3111 original commit: ce92ae725a8387b1244618aab1270266bfa9dd48 --- collects/net/url-unit.ss | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/collects/net/url-unit.ss b/collects/net/url-unit.ss index c5b2c5d..262bdda 100644 --- a/collects/net/url-unit.ss +++ b/collects/net/url-unit.ss @@ -21,6 +21,11 @@ "tcp-sig.ss") (provide url@) + ;; undocumented hook to allow testing + (provide set-url:os-type!) + (define url:os-type (system-type)) + (define (set-url:os-type! new) (set! url:os-type new)) + (define url@ (unit/sig net:url^ (import net:tcp^) @@ -146,7 +151,7 @@ (let ([elts (remove* '("") (map path/param-path (url-path url)))] [abs? (url-path-absolute? url)]) ;; See the discussion in PR8060 for an explanation - (if (eq? 'windows (system-type)) + (if (eq? 'windows url:os-type) (let ([host (or (url-host url) "")]) (unless (equal? "" host) (set! elts (cons host elts))) (if (null? elts) @@ -391,7 +396,7 @@ (lambda (scheme user host port path query fragment) ;; Windows => "file://xxx:/...." specifies a "xxx:/..." path (when (and (equal? "" port) (equal? "file" scheme) - (eq? 'windows (system-type))) + (eq? 'windows url:os-type)) (set! path (string-append host ":" path)) (set! host #f)) (let* ([user (uri-decode/maybe user)]