emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ssh-deploy 85a7c37 080/133: Added unit tests for asynch


From: Stefan Monnier
Subject: [elpa] externals/ssh-deploy 85a7c37 080/133: Added unit tests for asynchronous operations
Date: Sat, 27 Mar 2021 14:48:48 -0400 (EDT)

branch: externals/ssh-deploy
commit 85a7c3704bb91ce200d8907666ed12833c4adcff
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Added unit tests for asynchronous operations
---
 ssh-deploy-test.el | 12 ++++++++++++
 ssh-deploy.el      |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index 382f87b..fd9537d 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -87,6 +87,8 @@
 
         ;; Download file
         (ssh-deploy-download file-b file-a 0 nil 0)
+        (when (> async 0)
+          (sleep-for 1))
 
         ;; Verify that both files have equal contents
         (should (equal t (ediff-same-file-contents file-a file-b)))
@@ -154,6 +156,8 @@
         ;; Rename filename
         (find-file file-a-old)
         (ssh-deploy-rename file-a-old file-a-new)
+        (when (> async 0)
+          (sleep-for 1))
 
         ;; Both old files should not exist anymore
         (should (equal nil (file-exists-p file-a-old)))
@@ -165,6 +169,8 @@
 
         ;; Delete file
         (ssh-deploy-delete-both file-a-new)
+        (when (> async 0)
+          (sleep-for 1))
         (kill-buffer)
 
         ;; Both new files should not exist anymore
@@ -213,6 +219,8 @@
         (find-file file-a)
         (insert file-a-contents)
         (save-buffer) ;; NOTE Should trigger upload action
+        (when (> async 0)
+          (sleep-for 1))
 
         ;; Verify that both files have equal contents
         (should (equal t (ediff-same-file-contents file-a file-b)))
@@ -225,11 +233,15 @@
             ;; Update should not trigger upload
             (insert file-a-contents)
             (save-buffer)
+            (when (> async 0)
+              (sleep-for 1))
 
             ;; Verify that both files have equal contents
             (should (equal nil (ediff-same-file-contents file-a file-b)))
 
             (ssh-deploy-upload-handler)
+            (when (> async 0)
+              (sleep-for 1))
             (kill-buffer)
 
             ;; Verify that both files have equal contents
diff --git a/ssh-deploy.el b/ssh-deploy.el
index 4961931..fa2d436 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -320,7 +320,7 @@
                    (when ftp-netrc
                      ;; Pass ange-ftp setting to asynchronous process
                      (defvar ange-ftp-netrc-filename ftp-netrc))
-                   (add-to-list 'load-path ,script-filename)
+                   (add-to-list 'load-path script-filename)
                    (autoload 'ediff-same-file-contents "ediff-util")
                    (autoload 'string-remove-prefix "subr-x")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]