feat(wpcarro/emacs): Package fs.el
According to SourceGraph, this is unused, but I'm checking it in for historical purposes. Change-Id: I24bcb1c71a9f6de527bb54057cf13d01493c45bf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6016 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com>
This commit is contained in:
parent
f957a57ad8
commit
081742a07e
3 changed files with 55 additions and 22 deletions
26
users/wpcarro/emacs/pkgs/fs/tests.el
Normal file
26
users/wpcarro/emacs/pkgs/fs/tests.el
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Dependencies
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(require 'ert)
|
||||
(require 'fs)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Tests
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(ert-deftest fs-test-ensure-file ()
|
||||
(let ((file "/tmp/file/a/b/c/file.txt"))
|
||||
;; Ensure this file doesn't exist first to prevent false-positives.
|
||||
(f-delete file t)
|
||||
(fs-ensure-file file)
|
||||
(should (and (f-exists? file)
|
||||
(f-file? file)))))
|
||||
|
||||
(ert-deftest fs-test-ensure-dir ()
|
||||
(let ((dir "/tmp/dir/a/b/c"))
|
||||
;; Ensure the directory doesn't exist.
|
||||
(f-delete dir t)
|
||||
(fs-ensure-dir dir)
|
||||
(should (and (f-exists? dir)
|
||||
(f-dir? dir)))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue