expander: fix module-path?
Fix `module-path?` to check the first character of a path string. Closes #1988
This commit is contained in:
parent
68a96e094e
commit
efe5d2d83f
|
@ -498,6 +498,13 @@
|
|||
(test #t module-path? "x/./foo.rkt")
|
||||
(test #t module-path? "x/.")
|
||||
(test #t module-path? "x/..")
|
||||
(test #f module-path? "@")
|
||||
(test #f module-path? "\0")
|
||||
(test #f module-path? "x@")
|
||||
(test #f module-path? "x\0")
|
||||
(test #f module-path? "@x")
|
||||
(test #f module-path? "\0x")
|
||||
|
||||
|
||||
(test #t module-path? (collection-file-path "module.rktl" "tests" "racket"))
|
||||
(test #t module-path? (string->path "x"))
|
||||
|
|
|
@ -128,7 +128,7 @@
|
|||
[saw-slash? (not file-end-ok?)]
|
||||
[saw-dot? #f])
|
||||
(cond
|
||||
[(not (zero? i))
|
||||
[(not (negative? i))
|
||||
;; check next character
|
||||
(define c (string-ref v i))
|
||||
(cond
|
||||
|
@ -314,7 +314,7 @@
|
|||
(define (test ok? v)
|
||||
(unless (equal? ok? (module-path? v))
|
||||
(error 'module-path?-test "failed ~s; expected ~a" v ok?)))
|
||||
|
||||
|
||||
(test #t "hello")
|
||||
(test #t "hello.rkt")
|
||||
(test #f "hello*ss")
|
||||
|
@ -342,6 +342,13 @@
|
|||
(test #t "x/.")
|
||||
(test #t "x/..")
|
||||
|
||||
(test #f "@")
|
||||
(test #f "\0")
|
||||
(test #f "x@")
|
||||
(test #f "x\0")
|
||||
(test #f "@x")
|
||||
(test #f "\0x")
|
||||
|
||||
(test #t (collection-file-path "module.rktl" "tests" "racket"))
|
||||
(test #t (string->path "x"))
|
||||
|
||||
|
|
|
@ -3093,7 +3093,7 @@ static const char *startup_source =
|
|||
"(lambda(i_26 prev-was-slash?_0 saw-slash?_0 saw-dot?_0)"
|
||||
"(begin"
|
||||
" 'loop"
|
||||
"(if(not(zero? i_26))"
|
||||
"(if(not(negative? i_26))"
|
||||
"(let-values()"
|
||||
"(let-values(((c_6)(string-ref v_36 i_26)))"
|
||||
"(if(char=? c_6 '#\\/)"
|
||||
|
|
Loading…
Reference in New Issue
Block a user