diff options
| author | cashmere <cashmere@autistici.org> | 2026-09-12 14:40:11 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-09-12 14:40:11 +0200 |
| commit | 9bfc7c38dd8988b4d9923dc0a421c027adcbf514 (patch) | |
| tree | f27830952d60e6790e59c3e7c63c6be3550a93fe /test | |
| parent | 77d69634bf4029e522d8a09e3a417f21dbd65f4d (diff) | |
| download | emacs-9bfc7c38dd8988b4d9923dc0a421c027adcbf514.tar.gz | |
relic: 2026-09-12T14:40:15+02:00
Diffstat (limited to 'test')
| -rw-r--r-- | test/fossil-ui-test.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fossil-ui-test.el b/test/fossil-ui-test.el index 80fd5c0..9032408 100644 --- a/test/fossil-ui-test.el +++ b/test/fossil-ui-test.el @@ -218,6 +218,27 @@ :key (lambda (change) (plist-get change :path)) :test #'equal))))) +(ert-deftest fossil-ui-missing-file-can-be-staged-unstaged-and-committed-as-deletion () + (fossil-ui-test--with-checkout + (delete-file (expand-file-name "tracked.txt" root)) + (let ((buffer (save-window-excursion (fossil-ui-status root)))) + (unwind-protect + (with-current-buffer buffer + (fossil-ui--goto-path "tracked.txt") + (should (equal (fossil-ui--status-at-point) "MISSING")) + (fossil-ui-stage) + (should (plist-get (car (plist-get (fossil-ui--index root) :entries)) :deleted)) + (should (equal (plist-get (car (fossil-ui--changes root)) :status) "DELETED")) + (fossil-ui--goto-path "tracked.txt" t) + (fossil-ui-unstage) + (should-not (plist-get (fossil-ui--index root) :entries)) + (should (equal (plist-get (car (fossil-ui--changes root)) :status) "DELETED")) + (fossil-ui--goto-path "tracked.txt") + (fossil-ui-stage) + (fossil-ui--commit-staged root "remove tracked file") + (should-not (member "tracked.txt" (split-string (fossil-ui-test--call root "ls" "-r" "current") "\n" t)))) + (when (buffer-live-p buffer) (kill-buffer buffer)))))) + (ert-deftest fossil-ui-staged-and-unstaged-inline-sections-are-independent () (fossil-ui-test--with-checkout (fossil-ui-test--write (expand-file-name "tracked.txt" root) "staged version\n") |
