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

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

[elpa] externals/ssh-deploy 0b43ceb 048/133: Added unit tests for get-re


From: Stefan Monnier
Subject: [elpa] externals/ssh-deploy 0b43ceb 048/133: Added unit tests for get-revision-path and is-not-empty-string
Date: Sat, 27 Mar 2021 14:48:41 -0400 (EDT)

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

    Added unit tests for get-revision-path and is-not-empty-string
---
 ssh-deploy-test.el | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/ssh-deploy-test.el b/ssh-deploy-test.el
index d0cffbc..043673a 100644
--- a/ssh-deploy-test.el
+++ b/ssh-deploy-test.el
@@ -37,10 +37,19 @@
 ;;; Code:
 
 
+(autoload 'should "ert")
+
 (autoload 'ssh-deploy-diff-mode "ssh-deploy-diff-mode")
+
 (autoload 'ssh-deploy "ssh-deploy")
+(autoload 'ssh-deploy--get-revision-path "ssh-deploy")
 (autoload 'ssh-deploy--file-is-in-path "ssh-deploy")
-(autoload 'should "ert")
+(autoload 'ssh-deploy--is-not-empty-string "ssh-deploy")
+
+(defun ssh-deploy-test--get-revision-path ()
+  "Test this function."
+  (should (string= (expand-file-name "./_mydirectory_random-file.txt") 
(ssh-deploy--get-revision-path "/mydirectory/random-file.txt" (expand-file-name 
"."))))
+  )
 
 (defun ssh-deploy-test--file-is-in-path ()
   "Test this function."
@@ -49,10 +58,18 @@
   (should (equal nil (ssh-deploy--file-is-in-path "/mydirectory2/test.txt" 
"/mydirectory/")))
   )
 
+(defun ssh-deploy-test--is-not-empty-string ()
+  "Test this function."
+  (should (equal t (ssh-deploy--is-not-empty-string "abc")))
+  (should (equal nil (ssh-deploy--is-not-empty-string "")))
+  (should (equal nil (ssh-deploy--is-not-empty-string nil)))
+  )
 
 (defun ssh-deploy-tests ()
   "Run test for plug-in."
+  (ssh-deploy-test--get-revision-path)
   (ssh-deploy-test--file-is-in-path)
+  (ssh-deploy-test--is-not-empty-string)
   )
 
 (ssh-deploy-tests)



reply via email to

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