diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2018-07-05 00:16:54 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2018-07-05 00:16:54 +0200 |
commit | ac6edbe71610b2d5bc1068a878ebabcfddad992c (patch) | |
tree | 308dad1e99136dd60486b68e87e5c43f2c8b0762 /cider-test.el | |
parent | 4e5dd39364538f248e9b0df81500263f0b8906d2 (diff) |
[Fix #2374] Eliminate nils from the creation of the test requests
The previous code didn't account for any nils that might come up
from the whens. Ideally we should just move this request building
to a unit testable function.
Diffstat (limited to 'cider-test.el')
-rw-r--r-- | cider-test.el | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/cider-test.el b/cider-test.el index d5765784..d62b6c82 100644 --- a/cider-test.el +++ b/cider-test.el @@ -648,16 +648,21 @@ The include/exclude selectors will be used to filter the tests before ;; we generate a different message when running individual tests (cider-test-echo-running ns (car tests)) (cider-test-echo-running ns))) - (let* ((request `("op" ,(cond ((stringp ns) "test") - ((eq :project ns) "test-all") - ((eq :loaded ns) "test-all") - ((eq :non-passing ns) "retest")))) - ;; we add optional parts of the request only when relevant - (request (when (and (listp include-selectors) include-selectors) (append request `("include" ,include-selectors)))) - (request (when (and (listp exclude-selectors) exclude-selectors) (append request `("exclude" ,exclude-selectors)))) - (request (when (stringp ns) (append request `("ns" ,ns)))) - (request (when (stringp ns) (append request `("tests" ,tests)))) - (request (when (or (stringp ns) (eq :project ns)) (append request `("load?" ,"true"))))) + (let ((request `("op" ,(cond ((stringp ns) "test") + ((eq :project ns) "test-all") + ((eq :loaded ns) "test-all") + ((eq :non-passing ns) "retest"))))) + ;; we add optional parts of the request only when relevant + (when (and (listp include-selectors) include-selectors) + (setq request (append request `("include" ,include-selectors)))) + (when (and (listp exclude-selectors) exclude-selectors) + (setq request (append request `("exclude" ,exclude-selectors)))) + (when (stringp ns) + (setq request (append request `("ns" ,ns)))) + (when (stringp ns) + (setq request (append request `("tests" ,tests)))) + (when (or (stringp ns) (eq :project ns)) + (setq request (append request `("load?" ,"true")))) (cider-nrepl-send-request request (lambda (response) |