[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/buttercup f577efc524 09/16: Remove remaining uses of `butt
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/buttercup f577efc524 09/16: Remove remaining uses of `buttercup--mark-stackframe' |
Date: |
Wed, 4 Sep 2024 18:59:24 -0400 (EDT) |
branch: elpa/buttercup
commit f577efc524f0dca38282a242898983d18fc6c960
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>
Remove remaining uses of `buttercup--mark-stackframe'
Recent changes in the backtrace code has made
`buttercup--mark-stackframe' redundant. Remove all uses and mentions
in code and tests.
---
buttercup.el | 14 ++++----------
tests/test-buttercup.el | 17 ++++++++---------
2 files changed, 12 insertions(+), 19 deletions(-)
diff --git a/buttercup.el b/buttercup.el
index 1558ef749d..3fc51db26a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -83,8 +83,8 @@ For Emacs < 29:
The function MUST be byte-compiled or have one of the following
forms:
-\(closure (ENVLIST) () (quote EXPR) (buttercup--mark-stackframe) EXPANDED)
-\(lambda () (quote EXPR) (buttercup--mark-stackframe) EXPR)
+\(closure (ENVLIST) () (quote EXPR) EXPANDED)
+\(lambda () (quote EXPR) EXPR)
and the return value will be EXPR, unevaluated. The quoted EXPR
is useful if EXPR is a macro call, in which case the `quote'
@@ -98,7 +98,7 @@ ensures access to the un-expanded form."
;; * the stackframe marker
;; * the macroexpanded original expression
(`(closure ,(pred listp) nil
- (quote ,expr) (buttercup--mark-stackframe) ,_expanded)
+ (quote ,expr) ,_expanded)
expr)
;; This a when FUN has not been evaluated.
;; Why does that happen?
@@ -107,7 +107,7 @@ ensures access to the un-expanded form."
;; * the stackframe marker
;; * the expanded expression
(`(lambda nil
- (quote ,expr) (buttercup--mark-stackframe) ,_expanded)
+ (quote ,expr) ,_expanded)
expr)
;; This is when FUN has been byte compiled, as when the entire
;; test file has been byte compiled. Check that it has an empty
@@ -188,11 +188,9 @@ Does not have the IGNORE-MISSING and SPLIT parameters."
"Wrap EXPR in a `buttercup--thunk' to be used by `buttercup-expect'."
(if (fboundp 'oclosure-lambda) ;Emacsā„29
`(oclosure-lambda (buttercup--thunk (expr ',expr)) ()
- (buttercup--mark-stackframe)
,expr)
`(lambda ()
(quote ,expr)
- (buttercup--mark-stackframe)
,expr)))
(defmacro expect (arg &optional matcher &rest args)
@@ -1015,7 +1013,6 @@ most probably including one or more calls to `expect'."
`(buttercup-it ,description
(lambda ()
(buttercup-with-converted-ert-signals
- (buttercup--mark-stackframe)
,@body)))
`(buttercup-xit ,description)))
@@ -2111,9 +2108,6 @@ ARGS according to `debugger'."
((buttercup-pending buttercup-failed))
(otherwise (buttercup--backtrace)))))))
-(defalias 'buttercup--mark-stackframe #'ignore
- "Marker to find where the backtrace start.")
-
(defun buttercup--backtrace ()
"Create a backtrace, a list of frames returned from `backtrace-frame'."
;; Read the backtrace frames from `buttercup--debugger' + 1 upward.
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 6aa4cf35c7..08be241c33 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -180,18 +180,18 @@ before it's processed by other functions."
"Not testable on Emacs 30+, not relevant for Emacs 29+")
(expect (buttercup--enclosed-expr
(let ((_foo 1))
- (lambda () '(ignore) (buttercup--mark-stackframe) (ignore))))
+ (lambda () '(ignore) (ignore))))
:to-equal '(ignore)))
(it "a lambda with expression copy?"
;; I suspect there is nothing to make sure that the quoted
;; expression matches the actual expression
(expect (buttercup--enclosed-expr
- '(lambda () (quote (ignore)) (buttercup--mark-stackframe)
(ignore))))
+ '(lambda () (quote (ignore)) (ignore))))
:to-equal '(ignore))
(describe "byte compiled"
(it "lambda objects"
(expect (buttercup--enclosed-expr
- (byte-compile-sexp '(lambda () '(ignore)
(buttercup--mark-stackframe) (ignore))))))
+ (byte-compile-sexp '(lambda () '(ignore) (ignore))))))
(it "wrapped expression"
(assume (not (fboundp 'buttercup--thunk-p)) "Not with Oclosures")
(expect (buttercup--enclosed-expr (byte-compile-sexp
(buttercup--wrap-expr '(ignore))))))))
@@ -202,15 +202,15 @@ before it's processed by other functions."
:to-throw 'buttercup-enclosed-expression-error))
(it "on a closure with stackframe marker but no quoted expression"
(expect
- (buttercup--enclosed-expr (let ((_foo 1)) (lambda ()
(buttercup--mark-stackframe) (ignore))))
+ (buttercup--enclosed-expr (let ((_foo 1)) (lambda () (ignore))))
:to-throw 'buttercup-enclosed-expression-error))
(it "for multi-statement closures"
(expect (buttercup--enclosed-expr
- (lambda () '(+ 1 2) (buttercup--mark-stackframe) (+ 1 2)
(ignore)))
+ (lambda () '(+ 1 2) (+ 1 2) (ignore)))
:to-throw 'buttercup-enclosed-expression-error))
(it "for closures with non-empty argument lists"
(expect (buttercup--enclosed-expr
- (lambda (foo) '(ignore foo) (buttercup--mark-stackframe)
(ignore foo)))
+ (lambda (foo) '(ignore foo) (ignore foo)))
:to-throw 'buttercup-enclosed-expression-error))
(it "on simple lambda objects"
(expect (buttercup--enclosed-expr
@@ -218,7 +218,7 @@ before it's processed by other functions."
:to-throw))
(it "on a lambda with stackframe marker but no quoted expression"
(expect (buttercup--enclosed-expr
- '(lambda () (buttercup--mark-stackframe) (ignore)))
+ '(lambda () (ignore)))
:to-throw 'buttercup-enclosed-expression-error))
(it "for multi-statement lambdas"
(expect (buttercup--enclosed-expr
@@ -230,7 +230,7 @@ before it's processed by other functions."
:to-throw 'buttercup-enclosed-expression-error))
(it "on byte-compiled functions with arguments"
(expect (buttercup--enclosed-expr
- (byte-compile-sexp '(lambda (_a) '(ignore)
(buttercup--mark-stackframe) (ignore))))
+ (byte-compile-sexp '(lambda (_a) '(ignore) (ignore))))
:to-throw 'buttercup-enclosed-expression-error))))
;;;;;;;;;;
@@ -1121,7 +1121,6 @@ before it's processed by other functions."
'(buttercup-it "description"
(lambda ()
(buttercup-with-converted-ert-signals
- (buttercup--mark-stackframe)
body)))))
(it "without argument should expand to xit."
- [nongnu] elpa/buttercup 0552fe4d5b 12/16: Add :to-be-close-to docstring, (continued)
- [nongnu] elpa/buttercup 0552fe4d5b 12/16: Add :to-be-close-to docstring, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup c8f34ae3ed 05/16: Limit backtraces for spec exceptions outside expect, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup add32f8cbf 08/16: Collect stacktraces for errors in matchers, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup be72aa872c 06/16: tests: Verify that backtraces are not collected for passed specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 8408579758 16/16: Rewrite buttercup-expect with pcase, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 925af155be 15/16: tests: Add backtrace tests for function matchers, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup df7f98e110 03/16: Do not collect backtraces for failed specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 4b1682ec98 01/16: Use the base argument of backtrace-frame, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup a1d0d73999 11/16: Improve docstring of buttercup-define-matcher, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 789570cf7d 10/16: Merge pull request #249 from snogge/fix-247, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup f577efc524 09/16: Remove remaining uses of `buttercup--mark-stackframe',
ELPA Syncer <=
- [nongnu] elpa/buttercup 9bb00a269d 13/16: Improve the docstring of the expect macro, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 19e1a86626 14/16: Clarify that buttercup--wrap-expr is only meant for expect, ELPA Syncer, 2024/09/04