diff options
author | Jeff Valk <jv@jeffvalk.com> | 2016-02-06 12:22:24 -0500 |
---|---|---|
committer | Jeff Valk <jv@jeffvalk.com> | 2016-02-06 12:22:24 -0500 |
commit | 463c3dc0f78d66a9c3163c16336657fda7257f99 (patch) | |
tree | 3ef4ac1bd5ab0a461f1d01964ac1212927190bc4 /cider-test.el | |
parent | a58aecf31324252c4e87a040ad3d603e8afa3851 (diff) |
Font lock result types in test report
Prior to use of a background color overlay for the test result, this
used the rather shouty highlighted faces. This makes font locking
compatible with the background overlay, and is a bit more subtle.
Diffstat (limited to 'cider-test.el')
-rw-r--r-- | cider-test.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cider-test.el b/cider-test.el index bae68f6c..3a59428a 100644 --- a/cider-test.el +++ b/cider-test.el @@ -304,6 +304,11 @@ With the actual value, the outermost '(not ...)' s-expression is removed." ("error" 'cider-test-error-face) (_ 'default))) +(defun cider-test-type-simple-face (type) + "Return a face for the test result TYPE using the highlight color as foreground." + (let ((face (cider-test-type-face type))) + `(:foreground ,(face-attribute face :background)))) + (defun cider-test-render-summary (buffer summary) "Emit into BUFFER the report SUMMARY statistics." (with-current-buffer buffer @@ -324,8 +329,9 @@ With the actual value, the outermost '(not ...)' s-expression is removed." (nrepl-dbind-response test (var context type message expected actual error) (cider-propertize-region (cider-intern-keys (cdr test)) (let ((beg (point)) - (bg `(:background ,cider-stacktrace-frames-background-color))) - (cider-insert (capitalize type) (cider-test-type-face type) nil " in ") + (type-face (cider-test-type-simple-face type)) + (bg `(:background ,cider-test-items-background-color))) + (cider-insert (capitalize type) type-face nil " in ") (cider-insert var 'font-lock-function-name-face t) (when context (cider-insert context 'font-lock-doc-face t)) (when message (cider-insert message 'font-lock-doc-string-face t)) |