]> gitweb.factorcode.org Git - factor.git/commitdiff
ftp.server: Don't fetch to the same directory we serve from or else it will overwrite...
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 15 Apr 2016 22:52:06 +0000 (15:52 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 15 Apr 2016 22:52:06 +0000 (15:52 -0700)
basis/ftp/server/server-tests.factor

index b37f31b342f8d087d8e3922ed76f7036c1258fee..ab3cd3a56f21bc85e6e9fab51ba8c5cf2c9065dc 100644 (file)
@@ -20,16 +20,22 @@ CONSTANT: test-file-contents "Files are so boring anymore."
 
 { t } [
     [
-        [ ftp-get ]
-        [ path>> file-name ascii file-contents ] bi
+        ! give client its own directory so we don't overwrite the ftp server's file
+        [
+            [ ftp-get ]
+            [ path>> file-name ascii file-contents ] bi
+        ] with-test-directory
     ] test-ftp-server test-file-contents =
 ] unit-test
 
 [
 
     [
-        "/" >>path
-        [ ftp-get ]
-        [ path>> file-name ascii file-contents ] bi
+        ! give client its own directory so we don't overwrite the ftp server's file
+        [
+            "/" >>path
+            [ ftp-get ]
+            [ path>> file-name ascii file-contents ] bi
+        ] with-test-directory
     ] test-ftp-server test-file-contents =
 ] must-fail