]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/automated/vc-bzr.el (vc-bzr-test-bug9781): New test.
authorGlenn Morris <rgm@gnu.org>
Thu, 20 Oct 2011 22:23:54 +0000 (18:23 -0400)
committerGlenn Morris <rgm@gnu.org>
Thu, 20 Oct 2011 22:23:54 +0000 (18:23 -0400)
test/ChangeLog
test/automated/vc-bzr.el

index 366ad44c712d4db59307554961e2c3cea8b6302b..396273bab372bd11d94be526f7408746d76a5b26 100644 (file)
@@ -1,5 +1,7 @@
 2011-10-20  Glenn Morris  <rgm@gnu.org>
 
+       * automated/vc-bzr.el (vc-bzr-test-bug9781): New test.
+
        * automated/vc-bzr.el: New file.
 
 2011-10-15  Glenn Morris  <rgm@gnu.org>
index 8a80fe280f250f283ece7c79f2d528feec010d90..b2cbda4d669f52360951db28976b25907c1dd10a 100644 (file)
             (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