[elpa] externals/hyperbole updated (3cda4a6 -> cd3c95a)

2021-07-18 Thread ELPA Syncer
elpasync pushed a change to branch externals/hyperbole.

  from  3cda4a6   Add hui:ebut-create and hui:ebut-modify tests (#106)
   new  590e361   Add gbut tests (#107)
   new  cd3c95a   Add ebut:program tests (#105)


Summary of changes:
 ChangeLog  | 13 +
 test/hbut-tests.el | 54 +++---
 test/hypb-tests.el |  1 +
 3 files changed, 65 insertions(+), 3 deletions(-)



[elpa] externals/hyperbole 590e361 1/2: Add gbut tests (#107)

2021-07-18 Thread ELPA Syncer
branch: externals/hyperbole
commit 590e3614910a71e84edc9ffbb9930684b293ee27
Author: Mats Lidell 
Commit: GitHub 

Add gbut tests (#107)
---
 ChangeLog  |  5 +
 test/hbut-tests.el | 28 
 2 files changed, 33 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c8f51b8..10714a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-07-11  Mats Lidell  
+
+* test/hbut-tests.el (gbut-program-calls-ebut-program)
+(gbut-program-link-to-directory): Add gbut tests.
+
 2021-07-04  Mats Lidell  
 
 * test/hui-tests.el (hui-ebut-create-link-to-www-url)
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index 396e9ac..1b53c9b 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -17,6 +17,8 @@
 
 (require 'ert)
 (require 'hbut)
+(require 'hactypes)
+(require 'el-mock)
 
 (ert-deftest ebut-program-link-to-directory ()
   "Programatically create ebut with link-to-directory."
@@ -69,5 +71,31 @@
 ))
   (delete-file file
 
+(ert-deftest gbut-program-calls-ebut-program ()
+  "Programatically create gbut calls ebut:program."
+  (let ((test-file (make-temp-file "test-file")))
+(setq test-buffer (find-file-noselect test-file))
+(unwind-protect
+(with-mock
+  (mock (find-file-noselect (expand-file-name hbmap:filename 
hbmap:dir-user)) => test-buffer)
+  (mock (ebut:program "label" 'actypes::link-to-directory "/tmp") => t)
+  (gbut:ebut-program "label" 'actypes::link-to-directory "/tmp"))
+  (delete-file test-file
+
+(ert-deftest gbut-program-link-to-directory ()
+  "Programatically create gbut with link-to-directory."
+  (let ((test-file (make-temp-file "gbut" nil ".txt")))
+(setq test-buffer (find-file-noselect test-file))
+(unwind-protect
+   (progn
+  (with-mock
+(mock (find-file-noselect (expand-file-name hbmap:filename 
hbmap:dir-user)) => test-buffer)
+(gbut:ebut-program "global" 'actypes::link-to-directory "/tmp"))
+ (with-current-buffer test-buffer
+(should (eq (hattr:get (hbut:at-p) 'actype) 
'actypes::link-to-directory))
+(should (equal (hattr:get (hbut:at-p) 'args) '("/tmp")))
+(should (equal (hattr:get (hbut:at-p) 'lbl-key) "global"
+  (delete-file test-file
+
 (provide 'hbut-tests)
 ;;; hbut-tests.el ends here



[elpa] externals/hyperbole cd3c95a 2/2: Add ebut:program tests (#105)

2021-07-18 Thread ELPA Syncer
branch: externals/hyperbole
commit cd3c95a243d8c0535cdaed5f5c1da03c66d375ba
Author: Mats Lidell 
Commit: GitHub 

Add ebut:program tests (#105)
---
 ChangeLog  |  8 
 test/hbut-tests.el | 34 +++---
 test/hypb-tests.el |  1 +
 3 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 10714a4..d9afc2e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,14 @@
 
 2021-07-04  Mats Lidell  
 
+* test/hbut-tests.el (ebut-program-link-to-directory)
+(ebut-program-link-to-directory-2, ebut-program-shell-cmd): Use
+actypes prefix after ebut:program change.
+
+* test/hbut-tests.el (hypb:program-create-ebut-in-buffer)
+(hypb:program-create-link-to-file-line-and-column-but-in-file): Add
+new test cases for ebut:program.
+
 * test/hui-tests.el (hui-ebut-create-link-to-www-url)
 
(hui-ebut-modify-link-to-www-url-keeping-all-values-should-not-modify-buffer-or-ebut):
 Add hui:ebut-create and hui:ebut-modify tests.
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index 1b53c9b..e10e319 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -33,14 +33,14 @@
   (delete-file file
 
 (ert-deftest ebut-program-link-to-directory-2 ()
-  "Programatically create ebut with link-to-directory."
+  "Programatically create ebut with link-to-directory using 
`temporary-file-directory`."
   (let ((file (make-temp-file "hypb_" nil ".txt")))
 (unwind-protect
 (progn
   (find-file file)
-  (ebut:program "label" 'link-to-directory (temporary-file-directory))
+  (ebut:program "label" 'link-to-directory temporary-file-directory)
   (should (eq (hattr:get (hbut:at-p) 'actype) 
'actypes::link-to-directory))
-  (should (equal (hattr:get (hbut:at-p) 'args) 
'((temporary-file-directory
+  (should (equal (hattr:get (hbut:at-p) 'args) (list 
temporary-file-directory)))
   (should (equal (hattr:get (hbut:at-p) 'lbl-key) "label")))
   (delete-file file
 
@@ -78,8 +78,8 @@
 (unwind-protect
 (with-mock
   (mock (find-file-noselect (expand-file-name hbmap:filename 
hbmap:dir-user)) => test-buffer)
-  (mock (ebut:program "label" 'actypes::link-to-directory "/tmp") => t)
-  (gbut:ebut-program "label" 'actypes::link-to-directory "/tmp"))
+  (mock (ebut:program "label" 'link-to-directory "/tmp") => t)
+  (gbut:ebut-program "label" 'link-to-directory "/tmp"))
   (delete-file test-file
 
 (ert-deftest gbut-program-link-to-directory ()
@@ -90,11 +90,31 @@
(progn
   (with-mock
 (mock (find-file-noselect (expand-file-name hbmap:filename 
hbmap:dir-user)) => test-buffer)
-(gbut:ebut-program "global" 'actypes::link-to-directory "/tmp"))
+(gbut:ebut-program "global" 'link-to-directory "/tmp"))
  (with-current-buffer test-buffer
 (should (eq (hattr:get (hbut:at-p) 'actype) 
'actypes::link-to-directory))
 (should (equal (hattr:get (hbut:at-p) 'args) '("/tmp")))
-(should (equal (hattr:get (hbut:at-p) 'lbl-key) "global"
+(should (equal (hattr:get (hbut:at-p) 'lbl-key) "global")))
+
+(ert-deftest hypb:program-create-ebut-in-buffer ()
+  "Create button with hypb:program in buffer.
+BUG: hbut:at-p does not recognise a button created within a buffer."
+  (with-temp-buffer
+(ebut:program "label" 'link-to-directory "/tmp")
+(should (eq (hattr:get (hbut:at-p) 'actype) 'actypes::link-to-directory))
+(should (equal (hattr:get (hbut:at-p) 'args) '("./tmp")))
+(should (equal (hattr:get (hbut:at-p) 'lbl-key) "label"
+
+(ert-deftest hypb:program-create-link-to-file-line-and-column-but-in-file ()
+  "Create button that links to file with line and column with hypb:program in 
buffer."
+  (let ((test-file (make-temp-file "test-file")))
+(unwind-protect
+(progn
+  (find-file test-file)
+  (ebut:program "label" 'link-to-file-line-and-column test-file 2 3)
+  (should (eq (hattr:get (hbut:at-p) 'actype) 
'actypes::link-to-file-line-and-column))
+  (should (equal (hattr:get (hbut:at-p) 'args) (list test-file 2 3)))
+  (should (equal (hattr:get (hbut:at-p) 'lbl-key) "label")))
   (delete-file test-file
 
 (provide 'hbut-tests)
diff --git a/test/hypb-tests.el b/test/hypb-tests.el
index 3109503..6e9d50e 100644
--- a/test/hypb-tests.el
+++ b/test/hypb-tests.el
@@ -16,6 +16,7 @@
 ;;; Code:
 
 (require 'hypb)
+(require 'hbut)
 (require 'ert)
 
 ;; Test for replace-regexp-in-string copied from emacs src