[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup b910b71 285/340: Extract buttercup--indented-des
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup b910b71 285/340: Extract buttercup--indented-description from the batch reporters |
Date: |
Thu, 16 Dec 2021 14:59:51 -0500 (EST) |
branch: elpa/buttercup
commit b910b718b7e12fc6298ac3597025d6e5a953928c
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
Extract buttercup--indented-description from the batch reporters
---
buttercup.el | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 8449d87..d010614 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -795,6 +795,12 @@ Return CHILD."
"Convert the elapsed time for SUITE-OR-SPEC to a short string."
(seconds-to-string (float-time (buttercup-elapsed-time suite-or-spec))))
+(defun buttercup--indented-description (suite-or-spec)
+ "Return the description of SUITE-OR-SPEC indented according to level.
+The indentaion is two spaces per parent."
+ (let ((level (length (buttercup-suite-or-spec-parents suite-or-spec))))
+ (concat (make-string (* 2 level) ?\s) (buttercup-suite-or-spec-description
suite-or-spec))))
+
;;;;;;;;;;;;;;;;;;;;
;;; Suites: describe
@@ -1572,17 +1578,9 @@ EVENT and ARG are described in `buttercup-reporter'."
(buttercup--print "Running %s specs.\n\n" defined))))
(`suite-started
- (let ((level (length (buttercup-suite-or-spec-parents arg))))
- (buttercup--print "%s%s\n"
- (make-string (* 2 level) ?\s)
- (buttercup-suite-description arg))))
-
+ (buttercup--print "%s\n" (buttercup--indented-description arg)))
(`spec-started
- (let ((level (length (buttercup-suite-or-spec-parents arg))))
- (buttercup--print "%s%s"
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description arg))))
-
+ (buttercup--print "%s" (buttercup--indented-description arg)))
(`spec-done
(cond
((eq (buttercup-spec-status arg) 'passed)) ; do nothing
@@ -1655,29 +1653,25 @@ EVENT and ARG are described in `buttercup-reporter'."
(unless (string-match-p "[\n\v\f]" (buttercup-spec-description arg))
(buttercup-reporter-batch event arg)))
(`spec-done
- (let ((level (length (buttercup-suite-or-spec-parents arg))))
(cond
((eq (buttercup-spec-status arg) 'passed)
- (buttercup--print (buttercup-colorize "\r%s%s" 'green)
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description arg)))
+ (buttercup--print (buttercup-colorize "\r%s" 'green)
+ (buttercup--indented-description arg)))
((eq (buttercup-spec-status arg) 'failed)
- (buttercup--print (buttercup-colorize "\r%s%s FAILED" 'red)
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description arg))
+ (buttercup--print (buttercup-colorize "\r%s FAILED" 'red)
+ (buttercup--indented-description arg))
(setq buttercup-reporter-batch--failures
(append buttercup-reporter-batch--failures
(list arg))))
((eq (buttercup-spec-status arg) 'pending)
(if (equal (buttercup-spec-failure-description arg) "SKIPPED")
(buttercup--print " %s" (buttercup-spec-failure-description arg))
- (buttercup--print (buttercup-colorize "\r%s%s %s" 'yellow)
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description arg)
+ (buttercup--print (buttercup-colorize "\r%s %s" 'yellow)
+ (buttercup--indented-description arg)
(buttercup-spec-failure-description arg))))
(t
(error "Unknown spec status %s" (buttercup-spec-status arg))))
- (buttercup--print " (%s)\n" (buttercup-elapsed-time-string arg))))
+ (buttercup--print " (%s)\n" (buttercup-elapsed-time-string arg)))
(`buttercup-done
(dolist (failed buttercup-reporter-batch--failures)
- [nongnu] elpa/buttercup 178c795 242/340: README: Add '-L .' to test runner example, (continued)
- [nongnu] elpa/buttercup 178c795 242/340: README: Add '-L .' to test runner example, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup fc4276a 247/340: Make it possible to abort test run cleanly, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup dbcd3d4 256/340: Calculate total test run time with current-time, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c83ba7d 268/340: Extract function buttercup-elapsed-time-string, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 38cfa6f 270/340: Fix spy-on on Emacs 24.3 for symbols that are not fbound, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 81bfed4 272/340: test: Add utility function send-string-to-ansi-buffer, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup cf4eee8 274/340: test: Verify output in the "The batch reporter" suite, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4159111 275/340: test: Verify full line for reporter spec-done tests, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup fbb790b 278/340: test: Add tests for buttercup-started and buttercup-reporter-batch-color, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d563e18 281/340: test: Add color tests for suite-done, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup b910b71 285/340: Extract buttercup--indented-description from the batch reporters,
ELPA Syncer <=
- [nongnu] elpa/buttercup e71a40f 287/340: Make sure carriage movement characters are not colorized, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup a22fc29 288/340: Bump version: 1.21 → 1.22, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup dde8651 290/340: Add new function buttercup--spec-mark-pending and use it, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c59110b 291/340: test: Extend with-local-buttercup with some key arguments, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d443ecb 293/340: Clarify patterns in bin/buttercup, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 4d1acb8 294/340: test: Rewrite buttercup-run tests using spies, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 37223e4 296/340: actions: Run actions on push for all branches, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 50c7fc2 297/340: Switch to pcase in spec-done case of buttercup-reporter-batch, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup dd32cc7 298/340: test: Fix "should color-print pending spec count in default color", ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0debeec 299/340: test: Use with-local-buttercup in more tests, ELPA Syncer, 2021/12/16