;ELC   
;;; Compiled
;;; in Emacs version 28.2
;;; with all optimizations.



(byte-code "\300\301!\210\300\302!\207" [require ert subr-x] 2)
#@124 Return a string containing STRING as a text button with PROPERTIES.

See `make-text-button'.

(fn STRING &rest PROPERTIES)
(defalias 'ert--text-button #[385 "\300\301\302\"r\211q\210\303\304\"\216c\210\305\306ed$\210\307 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] apply make-text-button buffer-string] 8 (#$ . 149)])
#@106 Compute a test buffer name based on BASE-NAME.

Helper function for `ert--test-buffers'.

(fn BASE-NAME)
(defalias 'ert--format-test-buffer-name #[257 "\301\302\303 \203  \303 \304!>\204 \305\306\307D\"\210\211\310H\262\206! \311\203, \301\312\"\202- \313#\207" [cl-struct-ert-test-tags format "*Test buffer (%s)%s*" ert-running-test type-of signal wrong-type-argument ert-test 1 "<anonymous test>" ": %s" ""] 8 (#$ . 553)])
#@233 Table of all test buffers.  Keys are the buffer objects, values are t.

The main use of this table is for `ert-kill-all-test-buffers'.
Not all buffers in this table are necessarily live, but all live
test buffers are in this table.
(defvar ert--test-buffers (make-hash-table :weakness t) (#$ . 992))
(define-button-type 'ert--test-buffer-button 'action 'ert--test-buffer-button-action 'help-echo "mouse-2, RET: Pop to test buffer")
#@69 Pop to the test buffer that BUTTON is associated with.

(fn BUTTON)
(defalias 'ert--test-buffer-button-action #[257 "\300\301\302\"!\207" [pop-to-buffer button-get ert--test-buffer] 5 (#$ . 1430)])
#@183 Helper function for `ert-with-test-buffer'.

Create a test buffer with a name based on ERT--BASE-NAME and run
ERT--THUNK with that buffer as current.

(fn ERT--BASE-NAME ERT--THUNK)
(defalias 'ert--call-with-test-buffer #[514 "\302\303!!\304\305!\306\307\310%\311\312#\210rq\210\313B	B *\314!\210\315\"\210\207" [ert--test-buffers ert--infos generate-new-buffer ert--format-test-buffer-name ert--text-button buffer-name :type ert--test-buffer-button ert--test-buffer puthash t "Buffer: " kill-buffer remhash] 9 (#$ . 1636)])
#@337 Create a test buffer and run BODY in that buffer.

To be used in ERT tests.  If BODY finishes successfully, the test
buffer is killed; if there is an error, the test buffer is kept
around for further inspection.  Its name is derived from
the name of the test and the result of NAME-FORM.

(fn (&key ((:name NAME-FORM) nil)) &body BODY)
(defalias 'ert-with-test-buffer '(macro . #[128 "\211\203 \211A\262\242\202 \300\301\302GD\"\303\304\"A@\211\203E \211@\305>\203. \211AA\262\202 \306>A@\203< \307\262\202 \310\311@\"\210\202 \210\312\313\307BBE\207" [signal wrong-number-of-arguments ert-with-test-buffer plist-member :name (:name :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:name)" ert--call-with-test-buffer lambda] 8 (#$ . 2180)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put ert-with-test-buffer edebug-form-spec ((":name" form) def-body) function-put lisp-indent-function 1] 4)
#@44 Kill all test buffers that are still live.
(defalias 'ert-kill-all-test-buffers #[0 "\301C\302\303\304\"\"\210\305\306\242\307!#\266\310!\210\311\207" [ert--test-buffers 0 maphash make-closure #[514 "\301!\203\f \302!\205 \300\211\242T\240\207" [V0 buffer-live-p kill-buffer] 4 "\n\n(fn BUFFER DUMMY)"] message "%s out of %s test buffers killed" hash-table-count clrhash nil] 6 (#$ . 3145) nil])
#@543 Simulate calling COMMAND the way the Emacs command loop would call it.

This effectively executes

  (apply (car COMMAND) (cdr COMMAND))

and returns the same value, but additionally runs hooks like
`pre-command-hook' and `post-command-hook', and sets variables
like `this-command' and `last-command'.

COMMAND should be a list where the car is the command symbol and
the rest are arguments to the command.

NOTE: Since the command is not called by `call-interactively'
test for `called-interactively' in the command will fail.

(fn COMMAND)
(defalias 'ert-simulate-command #[257 "\211<\204 \306\307\310C\310$\210\311@!\204 \306\312\310@C\310$\210\203) \306\313\310C\310$\210\310\211@\314\n!\2066 \n\315\316!\210\317@A\"\262\315\320!\210\321\304!\203U \f\203U \315\322!\210@\321\323!\203d 	\203p \203p \301 \210\203| \306\324\310C\310$\210\207" [unread-command-events deactivate-mark this-original-command this-command deferred-action-list real-last-command cl--assertion-failed (listp command) nil commandp (commandp (car command)) (not unread-command-events) command-remapping run-hooks pre-command-hook apply post-command-hook boundp deferred-action-function last-repeatable-command (not unread-command-events) last-command transient-mark-mode] 7 (#$ . 3557)])
#@75 Execute BODY with KEYS as pseudo-interactive input.

(fn KEYS &rest BODY)
(defalias 'ert-simulate-keys '(macro . #[385 "\300\301\302\303BBD\304BBB\207" [let unread-command-events append ('(7 7 7)) ((executing-kbd-macro t))] 7 (#$ . 4853)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put ert-simulate-keys edebug-form-spec t function-put lisp-indent-function 1] 4)
#@47 Run all idle timers (from `timer-idle-list').
(defalias 'ert-run-idle-timers #[0 "\301!\211\205 \211@\302!\210A\266\202\202 \207" [timer-idle-list copy-sequence timer-event-handler] 4 (#$ . 5244)])
#@289 Return a copy of S with all matches of REGEXPS removed.

Elements of REGEXPS may also be two-element lists (REGEXP
SUBEXP), where SUBEXP is the number of a subexpression in
REGEXP.  In that case, only that subexpression will be removed
rather than the entire match.

(fn S &rest REGEXPS)
(defalias 'ert-filter-string #[385 "\300\301\302\"r\211q\210\303\304\"\216c\210\211\203[ \211@\211<\203  \211\202# \211\305B\211G\306U\2033 \211A\262\242\202: \307\310\311GD\"\242eb\210\312\313\302#\203R \314\315\302\211\313%\210\202? \266A\266\202\202 \210\316 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] (nil) 2 signal wrong-number-of-arguments (regexp subexp) re-search-forward nil replace-match "" buffer-string] 14 (#$ . 5454)])
#@643 Return a string with properties as specified by ARGS.

ARGS is a list of strings and plists.  The strings in ARGS are
concatenated to produce an output string.  In the output string,
each string from ARGS will be have the preceding plist as its
property list, or no properties if there is no plist before it.

As a simple example,

(ert-propertized-string "foo " \='(face italic) "bar" " baz" nil " quux")

would return the string "foo bar baz quux" where the substring
"bar baz" has a `face' property with the value `italic'.

None of the ARGS are modified, but the return value may share
structure with the plists in ARGS.

(fn &rest ARGS)
(defalias 'ert-propertized-string #[128 "\300\301\302\"r\211q\210\303\304\"\216\305\305:\203T @\262\211;\203- `c\210\306`#\266\202M \211<\203G \307G\310\"\311U\204A \312\313\"\210\211\262\202M \312\314\315#\210A\262\202 \266\316 *\207" [generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205	 \302\300!\207" [V0 buffer-name kill-buffer] 2] nil set-text-properties mod 2 0 error "Odd number of args in plist: %S" "cl-etypecase failed: %s, %s" (string list) buffer-string] 10 (#$ . 6271)])
#@394 Protect the buffer named BUFFER-NAME from side-effects and run THUNK.

Renames the buffer BUFFER-NAME to a new temporary name, creates a
new buffer named BUFFER-NAME, executes THUNK, kills the new
buffer, and renames the original buffer back to BUFFER-NAME.

This is useful if THUNK has undesirable side-effects on an Emacs
buffer with a fixed name such as *Messages*.

(fn BUFFER-NAME THUNK)
(defalias 'ert-call-with-buffer-renamed #[514 "\300\301\302\"!r\303!q\210\304!\210)\305\306#\216\303!\210 )\207" [generate-new-buffer-name format "%s orig buffer" get-buffer-create rename-buffer make-closure #[0 "\302\300!\203\n \303\300!\210r\301q\210\304\300!)\207" [V0 V1 get-buffer kill-buffer rename-buffer] 2]] 7 (#$ . 7435)])
#@155 Protect the buffer named BUFFER-NAME from side-effects and run BODY.

See `ert-call-with-buffer-renamed' for details.

(fn (BUFFER-NAME-FORM) &body BODY)
(defalias 'ert-with-buffer-renamed '(macro . #[128 "\211\203 \211A\262\242\202 \300\301\302GD\"\211G\303U\203  \211\242\202' \300\301\302GD\"\304\305\306BBE\207" [signal wrong-number-of-arguments ert-with-buffer-renamed 1 ert-call-with-buffer-renamed lambda nil] 8 (#$ . 8175)]))
(byte-code "\300\301\302\303#\300\207" [function-put ert-with-buffer-renamed lisp-indent-function 1] 4)
#@136 Return the contents of BUFFER after reindentation.

BUFFER defaults to current buffer.  Does not modify BUFFER.

(fn &optional BUFFER)
(defalias 'ert-buffer-string-reindented #[256 "r\211\206 pq\210\302C\303\304\"\216\302\211\305 \240\210)r\211\242q\210\306\307ed\"\210)\310 *\262)\207" [buffer-file-name inhibit-read-only nil make-closure #[0 "\300\242\205\f \302\303\300\242!)\207" [V0 kill-buffer-query-functions nil kill-buffer] 2] clone-buffer t indent-region buffer-string] 5 (#$ . 8729)])
#@499 Execute BODY while collecting messages in VAR.

Capture messages issued by Lisp code and concatenate them
separated by newlines into one string.  This includes messages
written by `message' as well as objects printed by `print',
`prin1' and `princ' to the echo area.  Messages issued from C
code using the above mentioned functions will not be captured.

This is useful for separating the issuance of messages by the
code under test from the behavior of the *Messages* buffer.

(fn VAR &rest BODY)
(defalias 'ert-with-message-capture '(macro . #[385 "\300 \300 \300 \301\302B\303\304\305\n\306\f\307BBEED\310DD\311DDF\312\313\314F\312\315\314F\312\316\314F\312\317\314	F\320\321B\322\323E\322\324\fE\322\325E\322\326E\257\257\207" [gensym let* ("") lambda (msg) setq concat (msg) ert--make-message-advice ert--make-print-advice advice-add 'message :around 'prin1 'princ 'print unwind-protect progn advice-remove 'print 'princ 'prin1 'message] 19 (#$ . 9238)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put ert-with-message-capture edebug-form-spec (symbolp body) function-put lisp-indent-function 1] 4)
#@165 Create around advice for `message' for `ert-collect-messages'.
COLLECTOR will be called with the message before it is passed
to the real `message'.

(fn COLLECTOR)
(defalias 'ert--make-message-advice #[257 "\300\301\"\207" [make-closure #[385 "\211\203 \211@\301\235\203 \302\"\207\302\303\"\300\304P!\210\305\"\207" [V0 ("" nil) apply format-message "\n" "%s"] 6 "\n\n(fn FUNC &rest ARGS)"]] 4 (#$ . 10395)])
#@397 Create around advice for print functions for `ert-collect-messages'.
The created advice function will just call the original function
unless the output is going to the echo area (when PRINTCHARFUN is
t or PRINTCHARFUN is nil and `standard-output' is t).  If the
output is destined for the echo area, the advice function will
convert it to a string and pass it to COLLECTOR first.

(fn COLLECTOR)
(defalias 'ert--make-print-advice #[257 "\300\301\"\207" [make-closure #[770 "\211\206 	\302=\204 \"\207\300\303\304\302\"\305\216	!\210)r	q\210\306 +!\210\"\207" [V0 standard-output t generate-new-buffer " *string-output*" #[0 "\301!\207" [standard-output kill-buffer] 2] buffer-string] 7 "\n\n(fn FUNC OBJECT &optional PRINTCHARFUN)"]] 4 (#$ . 10821)])
#@38 Format for `ert-resource-directory'.
(defvar ert-resource-directory-format "%s-resources/" (#$ . 11592))
#@67 Regexp for `string-trim' (left) used by `ert-resource-directory'.
(defvar ert-resource-directory-trim-left-regexp "" (#$ . 11703))
#@68 Regexp for `string-trim' (right) used by `ert-resource-directory'.
(defvar ert-resource-directory-trim-right-regexp "\\(-tests?\\)?\\.el" (#$ . 11840))
#@644 Return absolute file name of the resource (test data) directory.

The path to the resource directory is the "resources" directory
in the same directory as the test file this is called from.

If that directory doesn't exist, find a directory based on the
test file name.  If the file is named "foo-tests.el", return
the absolute file name for "foo-resources".

If you want a different resource directory naming scheme, set the
variable `ert-resource-directory-format'.  Before formatting, the
file name will be trimmed using `string-trim' with arguments
`ert-resource-directory-trim-left-regexp' and
`ert-resource-directory-trim-right-regexp'.
(defalias 'ert-resource-directory '(macro . #[0 "\301\302\303 \206 D\304B\305BB\207" [buffer-file-name let* testfile macroexp-file-name ((default-directory (file-name-directory testfile))) ((file-truename (if (file-accessible-directory-p "resources/") (expand-file-name "resources/") (expand-file-name (format ert-resource-directory-format (string-trim testfile ert-resource-directory-trim-left-regexp ert-resource-directory-trim-right-regexp))))))] 3 (#$ . 11999)]))
#@192 Return absolute file name of resource (test data) file named FILE.
A resource file is defined as any file placed in the resource
directory as returned by `ert-resource-directory'.

(fn FILE)
(defalias 'ert-resource-file '(macro . #[257 "\300\301BB\207" [expand-file-name ((ert-resource-directory))] 4 (#$ . 13119)]))
(provide 'ert-x)
