From e195ae68f843264360ae147e1bc1d47ede35ad7a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 20 Oct 2011 18:23:54 -0400 Subject: [PATCH] * test/automated/vc-bzr.el (vc-bzr-test-bug9781): New test. --- test/ChangeLog | 2 ++ test/automated/vc-bzr.el | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/test/ChangeLog b/test/ChangeLog index 366ad44c712..396273bab37 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,5 +1,7 @@ 2011-10-20 Glenn Morris + * automated/vc-bzr.el (vc-bzr-test-bug9781): New test. + * automated/vc-bzr.el: New file. 2011-10-15 Glenn Morris diff --git a/test/automated/vc-bzr.el b/test/automated/vc-bzr.el index 8a80fe280f2..b2cbda4d669 100644 --- a/test/automated/vc-bzr.el +++ b/test/automated/vc-bzr.el @@ -61,4 +61,41 @@ (should (search-forward "unregistered" nil t)))) (delete-directory tempdir t)))) +;; Not specific to bzr. +(ert-deftest vc-bzr-test-bug9781 () + "Test for http://debbugs.gnu.org/9781 ." + :expected-result (if (executable-find vc-bzr-program) :passed :failed) + (should (executable-find vc-bzr-program)) + (let* ((tempdir (make-temp-file "vc-bzr-test" t)) + (subdir (expand-file-name "subdir" tempdir)) + (file (expand-file-name "file" tempdir)) + (default-directory (file-name-as-directory tempdir))) + (unwind-protect + (progn + (call-process vc-bzr-program nil nil nil "init") + (make-directory subdir) + (with-temp-buffer + (insert "text") + (write-region nil nil file nil 'silent) + (write-region nil nil (expand-file-name "subfile" subdir) + nil 'silent)) + (call-process vc-bzr-program nil nil nil "add") + (call-process vc-bzr-program nil nil nil "commit" "-m" "Commit 1") + (call-process vc-bzr-program nil nil nil "remove" subdir) + (with-temp-buffer + (insert "different text") + (write-region nil nil file nil 'silent)) + (vc-dir tempdir) + (while (vc-dir-busy) + (sit-for 0.1)) + (vc-dir-mark-all-files t) + (let ((f (symbol-function 'y-or-n-p))) + (unwind-protect + (progn + (fset 'y-or-n-p (lambda (prompt) t)) + (vc-next-action nil)) + (fset 'y-or-n-p f))) + (should (get-buffer "*vc-log*"))) + (delete-directory tempdir t)))) + ;;; vc-bzr.el ends here -- 2.39.2