rejeep / f.el

Modern API for working with files and directories in Emacs
GNU General Public License v3.0
680 stars 68 forks source link

Tests broken on Emacs master #83

Closed phst closed 6 years ago

phst commented 6 years ago

Emacs master (and the pretest for 26) have changed the semantics of various file operations due to security concerns, causing several f.el tests to fail. Specifically:

$ make EMACS=/home/p/emacs-master/src/emacs
rm -f f.elc
make unit
make[1]: Entering directory '/home/p/f.el'
cask exec ert-runner
...........................Test f-copy-contents-test/copy-directory backtrace:

  copy-file("/home/p/f.el/test/playgrou
  (if (f-file\? from) (copy-file from to) (if (> emacs-major-version 2
  (if f--guard-paths (if (---truthy\? (let (needle) (let ((list f--gua
  f-copy("/home/p/f.el/test/playground/
  (let ((it (car list))) (f-copy it to))
  (while list (let ((it (car list))) (f-copy it to)) (setq it-index (1
  (let ((list (f-entries from)) (it-index 0)) (while list (let ((it (c
  f-copy-contents("from" "to")
  (let ((default-directory f-test/playground-path)) (mapc (function (l
  (closure (t) nil (let ((default-directory f-test/playground-path)) (
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name f-copy-contents-test/copy-directory :
  ert-run-or-rerun-test(#s(ert--stats :selector (and t) :tests [#s(ert
  ert-run-tests((and t) (lambda (event-type &rest event-args) (cond ((
  ert-runner/run-tests-batch((and t))
  (let ((stats (ert-runner/run-tests-batch selector))) (kill-emacs (if
  ert-runner/run-tests-batch-and-exit((and t))
  (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runn
  (let ((test-files (ert-runner--test-files tests)) (test-helper (f-ex
  ert-runner/run()
  apply(ert-runner/run nil)
  commander--handle-command(nil)
  commander-parse(nil)
  (if commander-parsing-done nil (commander-parse (or commander-args (
  eval-buffer(#<buffer  *load*> nil "/home/p
  load-with-code-conversion("/home/p/f.
  load("/home/p/f.el/.cask/27.0/elpa/er
  command-line-1(("-scriptload" "/home/p
  command-line()
  normal-top-level()

Test f-copy-contents-test/copy-directory condition:

    (file-already-exists "File already exists" "/home/p/f.el/test/playground/to")

F...Test f-copy-test/copy-absolute-dir-exists backtrace:

  make-directory-internal("/home/p/f.el
  make-directory("/home/p/f.el/test/pla
  copy-directory("/home/p/f.el/test/pla
  (if (> emacs-major-version 23) (copy-directory from to) (if (f-dir\?
  (if (f-file\? from) (copy-file from to) (if (> emacs-major-version 2
  (if f--guard-paths (if (---truthy\? (let (needle) (let ((list f--gua
  f-copy("/home/p/f.el/test/playground/
  (let ((default-directory f-test/playground-path)) (mapc (function (l
  (closure (t) nil (let ((default-directory f-test/playground-path)) (
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name f-copy-test/copy-absolute-dir-exists 
  ert-run-or-rerun-test(#s(ert--stats :selector (and t) :tests [#s(ert
  ert-run-tests((and t) (lambda (event-type &rest event-args) (cond ((
  ert-runner/run-tests-batch((and t))
  (let ((stats (ert-runner/run-tests-batch selector))) (kill-emacs (if
  ert-runner/run-tests-batch-and-exit((and t))
  (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runn
  (let ((test-files (ert-runner--test-files tests)) (test-helper (f-ex
  ert-runner/run()
  apply(ert-runner/run nil)
  commander--handle-command(nil)
  commander-parse(nil)
  (if commander-parsing-done nil (commander-parse (or commander-args (
  eval-buffer(#<buffer  *load*> nil "/home/p
  load-with-code-conversion("/home/p/f.
  load("/home/p/f.el/.cask/27.0/elpa/er
  command-line-1(("-scriptload" "/home/p
  command-line()
  normal-top-level()

Test f-copy-test/copy-absolute-dir-exists condition:

    (file-already-exists "File exists" "/home/p/f.el/test/playground/bar")

F..Test f-copy-test/copy-relative-dir-exists backtrace:

  make-directory-internal("/home/p/f.el
  make-directory("/home/p/f.el/test/pla
  copy-directory("foo" "bar")
  (if (> emacs-major-version 23) (copy-directory from to) (if (f-dir\?
  (if (f-file\? from) (copy-file from to) (if (> emacs-major-version 2
  (if f--guard-paths (if (---truthy\? (let (needle) (let ((list f--gua
  f-copy("foo" "bar")
  (let ((default-directory f-test/playground-path)) (mapc (function (l
  (closure (t) nil (let ((default-directory f-test/playground-path)) (
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name f-copy-test/copy-relative-dir-exists 
  ert-run-or-rerun-test(#s(ert--stats :selector (and t) :tests [#s(ert
  ert-run-tests((and t) (lambda (event-type &rest event-args) (cond ((
  ert-runner/run-tests-batch((and t))
  (let ((stats (ert-runner/run-tests-batch selector))) (kill-emacs (if
  ert-runner/run-tests-batch-and-exit((and t))
  (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runn
  (let ((test-files (ert-runner--test-files tests)) (test-helper (f-ex
  ert-runner/run()
  apply(ert-runner/run nil)
  commander--handle-command(nil)
  commander-parse(nil)
  (if commander-parsing-done nil (commander-parse (or commander-args (
  eval-buffer(#<buffer  *load*> nil "/home/p
  load-with-code-conversion("/home/p/f.
  load("/home/p/f.el/.cask/27.0/elpa/er
  command-line-1(("-scriptload" "/home/p
  command-line()
  normal-top-level()

Test f-copy-test/copy-relative-dir-exists condition:

    (file-already-exists "File exists" "/home/p/f.el/test/playground/bar")

F........................................................................................................Test f-move-test/move-absolute-path backtrace:

  rename-file("/home/p/f.el/test/playgr
  (if f--guard-paths (if (---truthy\? (let (needle) (let ((list f--gua
  f-move("/home/p/f.el/test/playground/
  (let ((default-directory f-test/playground-path)) (mapc (function (l
  (closure (t) nil (let ((default-directory f-test/playground-path)) (
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name f-move-test/move-absolute-path :docum
  ert-run-or-rerun-test(#s(ert--stats :selector (and t) :tests [#s(ert
  ert-run-tests((and t) (lambda (event-type &rest event-args) (cond ((
  ert-runner/run-tests-batch((and t))
  (let ((stats (ert-runner/run-tests-batch selector))) (kill-emacs (if
  ert-runner/run-tests-batch-and-exit((and t))
  (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runn
  (let ((test-files (ert-runner--test-files tests)) (test-helper (f-ex
  ert-runner/run()
  apply(ert-runner/run nil)
  commander--handle-command(nil)
  commander-parse(nil)
  (if commander-parsing-done nil (commander-parse (or commander-args (
  eval-buffer(#<buffer  *load*> nil "/home/p
  load-with-code-conversion("/home/p/f.
  load("/home/p/f.el/.cask/27.0/elpa/er
  command-line-1(("-scriptload" "/home/p
  command-line()
  normal-top-level()

Test f-move-test/move-absolute-path condition:

    (file-error "Renaming" "Is a directory" "/home/p/f.el/test/playground/foo.txt" "/home/p/f.el/test/playground/bar")

FTest f-move-test/move-relative-path backtrace:

  rename-file("foo.txt" "bar" t)
  (if f--guard-paths (if (---truthy\? (let (needle) (let ((list f--gua
  f-move("foo.txt" "bar")
  (let ((default-directory f-test/playground-path)) (mapc (function (l
  (closure (t) nil (let ((default-directory f-test/playground-path)) (
  ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
  ert-run-test(#s(ert-test :name f-move-test/move-relative-path :docum
  ert-run-or-rerun-test(#s(ert--stats :selector (and t) :tests [#s(ert
  ert-run-tests((and t) (lambda (event-type &rest event-args) (cond ((
  ert-runner/run-tests-batch((and t))
  (let ((stats (ert-runner/run-tests-batch selector))) (kill-emacs (if
  ert-runner/run-tests-batch-and-exit((and t))
  (if ert-runner-verbose (ert-runner/run-tests-batch-and-exit ert-runn
  (let ((test-files (ert-runner--test-files tests)) (test-helper (f-ex
  ert-runner/run()
  apply(ert-runner/run nil)
  commander--handle-command(nil)
  commander-parse(nil)
  (if commander-parsing-done nil (commander-parse (or commander-args (
  eval-buffer(#<buffer  *load*> nil "/home/p
  load-with-code-conversion("/home/p/f.
  load("/home/p/f.el/.cask/27.0/elpa/er
  command-line-1(("-scriptload" "/home/p
  command-line()
  normal-top-level()

Test f-move-test/move-relative-path condition:

    (file-error "Renaming" "Is a directory" "/home/p/f.el/test/playground/foo.txt" "/home/p/f.el/test/playground/bar")

F........................................................................................

Ran 229 tests in 29.509 seconds
5 unexpected results:
   FAILED  f-copy-contents-test/copy-directory
   FAILED  f-copy-test/copy-absolute-dir-exists
   FAILED  f-copy-test/copy-relative-dir-exists
   FAILED  f-move-test/move-absolute-path
   FAILED  f-move-test/move-relative-path
Makefile:13: recipe for target 'unit' failed
make[1]: *** [unit] Error 1
make[1]: Leaving directory '/home/p/f.el'
Makefile:7: recipe for target 'test' failed
make: *** [test] Error 2