diff --git a/buttercup.el b/buttercup.el index 1558ef7..3fc51db 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 6aa4cf3..08be241 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."