[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup c1187b3 152/340: Extract function buttercup-suit
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup c1187b3 152/340: Extract function buttercup-suites-total-spces-status |
Date: |
Thu, 16 Dec 2021 14:59:23 -0500 (EST) |
branch: elpa/buttercup
commit c1187b34c11cdf4030c57427261f3af4d6374b15
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Jorgen Schäfer <Jorgen.Schaefer@gmail.com>
Extract function buttercup-suites-total-spces-status
Having a single function that handles all statuses allows for
reporters using more types of status such as error for specs that
throw unexpectedly.
---
buttercup.el | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index ffbc22d..a482ff6 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -714,26 +714,24 @@ See also `buttercup-define-matcher'."
(setq nspecs (1+ nspecs))))
nspecs))
-(defun buttercup-suites-total-specs-pending (suite-list)
- "Return the number of specs marked as pending in all suites in SUITE-LIST."
+(defun buttercup-suites-total-specs-status (suite-list status)
+ "Return the number of specs in SUITE-LIST marked with STATUS."
(let ((nspecs 0))
- (dolist (spec-or-suite (buttercup--specs-and-suites suite-list))
+ (dolist (spec-or-suite (buttercup--specs-and-suites suite-list) nspecs)
(when (and (buttercup-spec-p spec-or-suite)
- (eq (buttercup-spec-status spec-or-suite) 'pending))
- (setq nspecs (1+ nspecs))))
- nspecs))
+ (eq (buttercup-spec-status spec-or-suite) status))
+ (setq nspecs (1+ nspecs))))))
+
+(defun buttercup-suites-total-specs-pending (suite-list)
+ "Return the number of specs marked as pending in all suites in SUITE-LIST."
+ (buttercup-suites-total-specs-status suite-list 'pending))
(defun buttercup-suites-total-specs-failed (suite-list)
"Return the number of failed specs in all suites in SUITE-LIST."
- (let ((nspecs 0))
- (dolist (spec-or-suite (buttercup--specs-and-suites suite-list))
- (when (and (buttercup-spec-p spec-or-suite)
- (eq (buttercup-spec-status spec-or-suite) 'failed))
- (setq nspecs (1+ nspecs))))
- nspecs))
+ (buttercup-suites-total-specs-status suite-list 'failed))
(defun buttercup--specs-and-suites (spec-or-suite-list)
- "Return the number of specs defined in SUITE-OR-SPEC and its children."
+ "Return the number of specs defined in SPEC-OR-SUITE-LIST and its children."
(let ((specs-and-suites nil))
(dolist (spec-or-suite spec-or-suite-list)
(setq specs-and-suites (append specs-and-suites
- [nongnu] elpa/buttercup ab2a558 111/340: Add projectile integration info to Readme, (continued)
- [nongnu] elpa/buttercup ab2a558 111/340: Add projectile integration info to Readme, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0124cc4 129/340: Signal an error when ":to-throw" is used on a non-function (#97), ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 31e765b 142/340: Do not suppress errors while loading test files, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup bc13b53 183/340: Merge pull request #133 from snogge/fix-specs-in-pending-suites, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ca3ba8e 185/340: Merge pull request #130 from snogge/travis-update, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d6cf530 072/340: Clean up the interactive reporter., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 68c5ef5 076/340: Only load .el files during discovery., ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 14718c0 081/340: Use the new Travis infrastructure, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d00c164 083/340: Display description for pending specs, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ad901b5 149/340: Do not modify global match data in matchers, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup c1187b3 152/340: Extract function buttercup-suites-total-spces-status,
ELPA Syncer <=
- [nongnu] elpa/buttercup f565eda 157/340: Extract super-struct buttercup-suite-or-spec, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 0c1dcda 161/340: Fix docstring of buttercup--specs-and-suite, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 8d27bb9 169/340: Bump version: 1.10 → 1.11, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 45f40c7 174/340: Restore obsoletion version for buttercup-*-parents, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup d7ab592 080/340: Bump version: 1.1 → 1.2, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup e1f71ac 086/340: Bump version: 1.3 → 1.4, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 673f84d 087/340: Add assume form to cancel tests if conditions fail, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 2aa840c 088/340: Merge pull request #40 from lunaryorn/assume-form, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup 6c11d8e 097/340: Debian and Ubuntu installation instructions, ELPA Syncer, 2021/12/16
- [nongnu] elpa/buttercup ae606fc 153/340: Set failure description to empty string for pending specs, ELPA Syncer, 2021/12/16