diff --git a/extra/io/files/trash/trash-tests.factor b/extra/io/files/trash/trash-tests.factor new file mode 100644 index 0000000000..1c054d65be --- /dev/null +++ b/extra/io/files/trash/trash-tests.factor @@ -0,0 +1,10 @@ +! Copyright (C) 2020 Alexander Ilin. +! See http://factorcode.org/license.txt for BSD license. +USING: io.directories io.files.trash kernel tools.test ; +IN: io.files.trash.tests + +{ } [ + ! temp-file is not used here, because it returns the absolute path, and we + ! want to ensure send-to-trash works without giving it the full path. + [ "io.files.trash-tests" dup touch-file send-to-trash ] with-test-directory +] unit-test diff --git a/extra/io/files/trash/windows/windows.factor b/extra/io/files/trash/windows/windows.factor index f1b0d9ab0c..bfae7e66ee 100644 --- a/extra/io/files/trash/windows/windows.factor +++ b/extra/io/files/trash/windows/windows.factor @@ -2,8 +2,9 @@ ! See http://factorcode.org/license.txt for BSD license USING: accessors alien.c-types alien.data alien.strings -alien.syntax classes.struct destructors io.files.trash kernel -libc literals math sequences system windows.types ; +alien.syntax classes.struct destructors io.files.trash +io.pathnames kernel libc literals math sequences system +windows.types ; IN: io.files.trash.windows @@ -51,7 +52,7 @@ PRIVATE> M: windows send-to-trash ( path -- ) [ - native-string>alien B{ 0 0 } append + absolute-path native-string>alien B{ 0 0 } append malloc-byte-array &free SHFILEOPSTRUCTW