summaryrefslogtreecommitdiff
path: root/test/cider-stacktrace-tests.el
diff options
context:
space:
mode:
authorDan Sutton <danielsutton01@gmail.com>2017-07-12 20:58:04 -0500
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2017-07-15 10:33:18 +0300
commit16e2a7241fc84a68938555d762b09558483f8679 (patch)
tree720edbe8dd55d9ce0352e05f8c69e60c9a429700 /test/cider-stacktrace-tests.el
parent644b37c919a72103bafa8a4c9383e6b746d1573d (diff)
Introduce positive filters for stackframes
when filtering stackframes, there was only a "remove" type of filter. If we wish to filter to just our project, we need a way to ensure that project frames persist even if another tag says to remove it. This adds the "positive" filter mechanics.
Diffstat (limited to 'test/cider-stacktrace-tests.el')
-rw-r--r--test/cider-stacktrace-tests.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/cider-stacktrace-tests.el b/test/cider-stacktrace-tests.el
index 9431b2e9..7a206e4a 100644
--- a/test/cider-stacktrace-tests.el
+++ b/test/cider-stacktrace-tests.el
@@ -87,11 +87,12 @@
(defun cider--testing-dict (names &optional stipulated)
(let ((numeric? (lambda (sym) (member sym '(line column)))))
(apply #'nrepl-dict
- (append (mapcan (lambda (name) (list (symbol-name name)
+ (append (apply #'append
+ (mapcar (lambda (name) (list (symbol-name name)
(if (funcall numeric? name)
4
(symbol-name name))))
- names)
+ names))
stipulated))))
(defun cider--frame-of-type (flags)
@@ -114,3 +115,15 @@
(cider--testing-dict '(file path column line)))
(goto-char (point-min))
(expect (cider-stacktrace-frame-p) :to-be nil))))
+
+(describe "cider-stacktrace--should-hide-p-tests"
+ (it "should hide when members of the neg filters"
+ (let ((hidden1 (cider-stacktrace--should-hide-p '(a b c) '() '(a)))
+ (hidden2 (cider-stacktrace--should-hide-p '(a) '(b) '(a)))
+ (both (cider-stacktrace--should-hide-p '(a) '(a) '(a)))
+ (shown1 (cider-stacktrace--should-hide-p '(a) '(b) '(b)))
+ (shown2 (cider-stacktrace--should-hide-p '() '(a) '(a))))
+ (expect (and hidden1 hidden2)
+ :to-be-truthy)
+ (expect (or both shown1 shown2)
+ :to-be nil))))