[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master ba705c6 076/187: Add test for handling different ways of p
From: |
Michael Albinus |
Subject: |
[elpa] master ba705c6 076/187: Add test for handling different ways of passing a function |
Date: |
Wed, 30 Dec 2015 11:49:47 +0000 |
branch: master
commit ba705c61187e969a67ce59c38861154ce7144eec
Author: Ryan C. Thompson <address@hidden>
Commit: Ryan C. Thompson <address@hidden>
Add test for handling different ways of passing a function
---
async-test.el | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/async-test.el b/async-test.el
index b416c18..b77fdd1 100644
--- a/async-test.el
+++ b/async-test.el
@@ -252,6 +252,36 @@ Return the name of the directory."
(if (file-directory-p temp-dir) (delete-directory temp-dir t))
(if (file-directory-p temp-dir2) (delete-directory temp-dir2 t)))))
+(defun async-do-start-func-value-type-test ()
+ ;; Variable
+ (set 'myfunc-var (lambda () t))
+ ;; Function symbol
+ (fset 'myfunc-fsym myfunc-var)
+ ;; Defun
+ (defun myfunc-defun () t)
+
+ (should-error (error "ERROR"))
+
+ (should (eq t (eval '(async-sandbox myfunc-var))))
+ (should-error (eval '(async-sandbox 'myfunc-var)))
+ (should-error (eval '(async-sandbox #'myfunc-var)))
+
+ (should-error (eval '(async-sandbox myfunc-fsym)))
+ (should (eq t (eval '(async-sandbox 'myfunc-fsym))))
+ (should (eq t (eval '(async-sandbox #'myfunc-fsym))))
+
+ (should-error (eval '(async-sandbox myfunc-defun)))
+ (should (eq t (eval '(async-sandbox 'myfunc-defun))))
+ (should (eq t (eval '(async-sandbox #'myfunc-defun))))
+
+ (should (eq t (eval '(async-sandbox (lambda () t)))))
+ (should (eq t (eval '(async-sandbox '(lambda () t)))))
+ (should (eq t (eval '(async-sandbox #'(lambda () t)))))
+
+ (should-error (eval '(async-sandbox (closure (t) () t))))
+ (should (eq t (eval '(async-sandbox '(closure (t) () t)))))
+ (should (eq t (eval '(async-sandbox #'(closure (t) () t))))))
+
(defun async-do-lexbind-test ()
;; The `cl-loop' macro creates some lexical variables, and in this
;; case one of those variables (the one that collects the result)
@@ -314,6 +344,9 @@ Return the name of the directory."
(ert-deftest async-copy-directory-native-4 ()
(async-do-copy-directory-test t t t :use-native-commands t))
+(ert-deftest async-start-func-value-type-test ()
+ (async-do-start-func-value-type-test))
+
(ert-deftest async-lexbind-test ()
(async-do-lexbind-test))
- [elpa] master 3544948 064/187: * helm-async.el (dired-create-files): No need to backquote callback., (continued)
- [elpa] master 3544948 064/187: * helm-async.el (dired-create-files): No need to backquote callback., Michael Albinus, 2015/12/30
- [elpa] master 8d38306 063/187: * helm-async.el: Untabify and reindent., Michael Albinus, 2015/12/30
- [elpa] master c029934 066/187: * helm-async.el: Add comments about incompatibility with dired-async.el and async-file.el., Michael Albinus, 2015/12/30
- [elpa] master fb8f10b 065/187: * helm-async.el (dired-create-files): Handle `dired-recursive-copies' when async too., Michael Albinus, 2015/12/30
- [elpa] master bcffaeb 067/187: * helm-async.el (dired-create-file): Revert changes in fb8f10b., Michael Albinus, 2015/12/30
- [elpa] master 8e05e02 070/187: Prevent accidental creation of lexical closures., Michael Albinus, 2015/12/30
- [elpa] master 9c02acd 069/187: Add test for #17., Michael Albinus, 2015/12/30
- [elpa] master 5ef546a 071/187: Have test file add its own directory to load path, Michael Albinus, 2015/12/30
- [elpa] master 242ae73 068/187: * helm-async.el: Fix error handling., Michael Albinus, 2015/12/30
- [elpa] master 93b05a9 073/187: More robust evaluation and closure-protection of start-func, Michael Albinus, 2015/12/30
- [elpa] master ba705c6 076/187: Add test for handling different ways of passing a function,
Michael Albinus <=
- [elpa] master b6d990d 075/187: Add lexbind test, Michael Albinus, 2015/12/30
- [elpa] master f6d7a74 074/187: Merge pull request #18 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30
- [elpa] master 9b5bb5c 072/187: Add more comprehensive testing for anti-closure feature, Michael Albinus, 2015/12/30
- [elpa] master 204750d 081/187: Revert "* helm-async.el: Fix error handling.", Michael Albinus, 2015/12/30
- [elpa] master b05c63a 083/187: Don't rely on async.el being in load-path., Michael Albinus, 2015/12/30
- [elpa] master 374f514 079/187: Complete the docstring for "async--get-function", Michael Albinus, 2015/12/30
- [elpa] master 9704eb8 080/187: Merge pull request #21 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30
- [elpa] master 4a7b07b 084/187: Merge pull request #23 from DarwinAwardWinner/no-load-path-fix, Michael Albinus, 2015/12/30
- [elpa] master 2a532d3 077/187: Replace closure prevention with closure sanitation, Michael Albinus, 2015/12/30
- [elpa] master f18c735 078/187: Merge pull request #19 from DarwinAwardWinner/lexbind-fix, Michael Albinus, 2015/12/30