Changed Paths to PathStrings in types where appropriate
original commit: f3c73a197e4379b6c852050ba0197dc3f31319a4
This commit is contained in:
parent
3de7ea8410
commit
5ea9af1a69
25
collects/tests/typed-scheme/succeed/pathstrings.rkt
Normal file
25
collects/tests/typed-scheme/succeed/pathstrings.rkt
Normal file
|
@ -0,0 +1,25 @@
|
|||
#lang typed/racket
|
||||
|
||||
(: no-exec (-> Void))
|
||||
(define (no-exec)
|
||||
|
||||
|
||||
(call-with-output-file "file.tmp"
|
||||
(lambda: ((port : Output-Port))
|
||||
(write "hello world" port)))
|
||||
(call-with-input-file "file.tmp"
|
||||
(lambda: ((port : Input-Port))
|
||||
(read port)))
|
||||
|
||||
(directory-list "/")
|
||||
(make-directory "tmp-dir")
|
||||
|
||||
(path-only "file.tmp")
|
||||
|
||||
(system #"echo foo")
|
||||
(system* "/bin/echo" "zzz" #"foo" (string->path "/"))
|
||||
(system/exit-code #"echo foo")
|
||||
(system*/exit-code "/bin/echo" "zzz" #"foo" (string->path "/"))
|
||||
|
||||
(void))
|
||||
|
|
@ -517,8 +517,8 @@
|
|||
|
||||
|
||||
|
||||
[call-with-input-file (-poly (a) (-String (-Input-Port . -> . a) #:mode (Un (-val 'binary) (-val 'text)) #f . ->key . a))]
|
||||
[call-with-output-file (-poly (a) (-String (-Output-Port . -> . a)
|
||||
[call-with-input-file (-poly (a) (-Pathlike (-Input-Port . -> . a) #:mode (Un (-val 'binary) (-val 'text)) #f . ->key . a))]
|
||||
[call-with-output-file (-poly (a) (-Pathlike (-Output-Port . -> . a)
|
||||
#:exists (one-of/c error 'append 'update 'replace 'truncate 'truncate/replace) #f
|
||||
#:mode (Un (-val 'binary) (-val 'text)) #f
|
||||
. ->key . a))]
|
||||
|
@ -535,7 +535,7 @@
|
|||
[directory-exists? (-> -Pathlike B)]
|
||||
[file-exists? (-> -Pathlike B)]
|
||||
[directory-list (cl-> [() (-lst -Path)]
|
||||
[(-Path) (-lst -Path)])]
|
||||
[(-Pathlike) (-lst -Path)])]
|
||||
[file-or-directory-modify-seconds
|
||||
(cl->* (-Pathlike . -> . -Nat)
|
||||
(-Pathlike (-val #f) . -> . -Nat)
|
||||
|
@ -669,7 +669,7 @@
|
|||
;; FIXME - this is too general
|
||||
[get-output-string (-> -Output-Port -String)]
|
||||
|
||||
[make-directory (-> -Path -Void)]
|
||||
[make-directory (-> -Pathlike -Void)]
|
||||
|
||||
[delete-file (-> -Pathlike -Void)]
|
||||
[make-namespace (->opt [(Un (-val 'empty) (-val 'initial))] -Namespace)]
|
||||
|
@ -846,7 +846,7 @@
|
|||
[normalize-path (cl->* (-Pathlike [-Pathlike] . ->opt . -Path))]
|
||||
[filename-extension (-Pathlike . -> . (-opt -Bytes))]
|
||||
[file-name-from-path (-Pathlike . -> . (-opt -Path))]
|
||||
[path-only (-Pathlike . -> . -Path)]
|
||||
[path-only (-Pathlike . -> . (-opt -Path))]
|
||||
[some-system-path->string (-Path . -> . -String)]
|
||||
[string->some-system-path
|
||||
(-String (Un (-val 'unix) (-val 'windows)) . -> . -Path)]
|
||||
|
@ -926,10 +926,10 @@
|
|||
(-> -String (-lst -String) -String))]
|
||||
|
||||
;; scheme/system
|
||||
[system (-String . -> . -Boolean)]
|
||||
[system* ((list -Pathlike) -String . ->* . -Boolean)]
|
||||
[system/exit-code (-String . -> . -Integer)]
|
||||
[system*/exit-code ((list -Pathlike) -String . ->* . -Integer)]
|
||||
[system ((Un -String -Bytes) . -> . -Boolean)]
|
||||
[system* ((list -Pathlike) (Un -Path -String -Bytes) . ->* . -Boolean)]
|
||||
[system/exit-code ((Un -String -Bytes) . -> . -Integer)]
|
||||
[system*/exit-code ((list -Pathlike) (Un -Path -String -Bytes) . ->* . -Integer)]
|
||||
|
||||
;; Byte and String Output (Section 12.3 of the Reference)
|
||||
;; some are now in base-env-indexing-abs.rkt
|
||||
|
|
Loading…
Reference in New Issue
Block a user