Minor append-path improvement

db4
Slava Pestov 2008-06-27 20:10:47 -05:00
parent 97983dabb5
commit bf490cda94
2 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,8 @@
IN: io.files.tests
USING: tools.test io.files io.files.private io threads kernel
continuations io.encodings.ascii io.files.unique sequences
strings accessors io.encodings.utf8 math destructors ;
strings accessors io.encodings.utf8 math destructors
namespaces ;
\ exists? must-infer
\ (exists?) must-infer
@ -276,3 +277,12 @@ strings accessors io.encodings.utf8 math destructors ;
[ "touch-twice-test" temp-file delete-file ] ignore-errors
[ ] [ 2 [ "touch-twice-test" temp-file touch-file ] times ] unit-test
! aum's bug
[
"." current-directory set
".." "resource-path" set
[ "../core/bootstrap/stage2.factor" ]
[ "resource:core/bootstrap/stage2.factor" (normalize-path) ]
unit-test
] with-scope

View File

@ -121,6 +121,7 @@ PRIVATE>
{
{ [ over empty? ] [ append-path-empty ] }
{ [ dup empty? ] [ drop ] }
{ [ over right-trim-separators "." = ] [ nip ] }
{ [ dup absolute-path? ] [ nip ] }
{ [ dup head.? ] [ rest left-trim-separators append-path ] }
{ [ dup head..? ] [