;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; 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 (#$ . 148)])#@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 (#$ . 551)])#@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) (#$ . 989))
(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 (#$ . 1426)])#@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 (#$ . 1631)])#@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\203P \211@\305>\2039 \211A\2041 \306\307@\"\210\211AA\262\202 \310>A@\203G \311\262\202 \306\312@\"\210\202 \210\313\314\311BBE\207" [signal wrong-number-of-arguments ert-with-test-buffer plist-member :name (:name :allow-other-keys) error "Missing argument for %s" :allow-other-keys nil "Keyword argument %s not one of (:name)" ert--call-with-test-buffer lambda] 8 (#$ . 2174)]))
(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)#@610 Display a buffer in a temporary selected window and run BODY.

If BUFFER-OR-NAME is nil, the current buffer is used.

The buffer is made the current buffer, and the temporary window
becomes the `selected-window', before BODY is evaluated.  The
modification hooks `before-change-functions' and
`after-change-functions' are not inhibited during the evaluation
of BODY, which makes it easier to use `execute-kbd-macro' to
simulate user interaction.  The window configuration is restored
before returning, even if BODY exits nonlocally.  The return
value is the last form in BODY.

(fn BUFFER-OR-NAME &body BODY)
(defalias 'ert-with-buffer-selected '(macro . #[385 "\300\301\302\303BB\304\305BBED\207" [save-window-excursion with-current-buffer or ((current-buffer)) with-selected-window (display-buffer (current-buffer))] 8 (#$ . 3192)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put ert-with-buffer-selected edebug-form-spec (form body) function-put lisp-indent-function 1] 4)#@194 Create a test buffer, switch to it, and run BODY.

This combines `ert-with-test-buffer' and
`ert-with-buffer-selected'.  The return value is the last form in
BODY.

(fn (&key NAME) &body BODY)
(defalias 'ert-with-test-buffer-selected '(macro . #[128 "\211\203 \211A\262\242\202 \300\301\302GD\"\303\304\"A@\211\203P \211@\305>\2039 \211A\2041 \306\307@\"\210\211AA\262\202 \310>A@\203G \311\262\202 \306\312@\"\210\202 \210\313\304D\314\315BBE\207" [signal wrong-number-of-arguments ert-with-test-buffer-selected plist-member :name (:name :allow-other-keys) error "Missing argument for %s" :allow-other-keys nil "Keyword argument %s not one of (:name)" ert-with-test-buffer ert-with-buffer-selected (current-buffer)] 8 (#$ . 4195)]))
(byte-code "\300\301\302\303#\210\304\301\305\306#\300\207" [put ert-with-test-buffer-selected edebug-form-spec ((":name" form) 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 (#$ . 5126) 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\322!\203U \f	\203a \203a \301 \210\203m \306\323\310C\310$\210\207" [unread-command-events deactivate-mark this-original-command this-command real-last-command 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 last-repeatable-command (not unread-command-events) transient-mark-mode] 7 (#$ . 5537)])#@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 (#$ . 6750)]))
(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 (#$ . 7140)])#@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 (#$ . 7349)])#@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 (#$ . 8165)])#@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\301!\203\n \303\301!\210r\300q\210\304\301!)\207" [V0 V1 get-buffer kill-buffer rename-buffer] 2]] 7 (#$ . 9328)])#@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 (#$ . 10067)]))
(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)\210r\211\242q\210\306\307ed\")\210\310 +\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 (#$ . 10621)])#@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 (#$ . 11124)]))
(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 (#$ . 12281)])#@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 #[1026 "\206 	\302=\204 \"\207\300\303\304\302\"\305\216	!)\210r	q\210\306 +!\210\"\207" [V0 standard-output t generate-new-buffer " *string-output*" #[0 "\301!\207" [standard-output kill-buffer] 2] buffer-string] 8 "\n\n(fn FUNC OBJECT &optional PRINTCHARFUN OVERRIDES)"]] 4 (#$ . 12706)])#@38 Format for `ert-resource-directory'.
(defvar ert-resource-directory-format "%s-resources/" (#$ . 13484))#@67 Regexp for `string-trim' (left) used by `ert-resource-directory'.
(defvar ert-resource-directory-trim-left-regexp "" (#$ . 13594))#@68 Regexp for `string-trim' (right) used by `ert-resource-directory'.
(defvar ert-resource-directory-trim-right-regexp "\\(-tests?\\)?\\.el" (#$ . 13730))#@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 DC\304BB\207" [buffer-file-name when-let testfile macroexp-file-name ((let ((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 (#$ . 13888)]))#@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 (#$ . 15013)]))#@68 Prefix used by `ert-with-temp-file' and `ert-with-temp-directory'.
(defvar ert-temp-file-prefix "emacs-test-" (#$ . 15336))#@68 Suffix used by `ert-with-temp-file' and `ert-with-temp-directory'.
(defvar ert-temp-file-suffix nil (#$ . 15465))#@57 Generate temp file suffix from FILENAME.

(fn FILENAME)
(defalias 'ert--with-temp-file-generate-suffix #[257 "\300\301\302\303\304!#P\207" ["-" replace-regexp-in-string "\\`\\(.+?\\)\\(?:-?tests?\\)\\'" "\\1" file-name-base] 7 (#$ . 15584)])#@1377 Bind NAME to the name of a new temporary file and evaluate BODY.
Delete the temporary file after BODY exits normally or
non-locally.  NAME will be bound to the file name of the temporary
file.

The following keyword arguments are supported:

:prefix STRING  If non-nil, pass STRING to `make-temp-file' as
                the PREFIX argument.  Otherwise, use the value of
                `ert-temp-file-prefix'.

:suffix STRING  If non-nil, pass STRING to `make-temp-file' as the
                SUFFIX argument.  Otherwise, use the value of
                `ert-temp-file-suffix'; if the value of that
                variable is nil, generate a suffix based on the
                name of the file that `ert-with-temp-file' is
                called from.

:text STRING    If non-nil, pass STRING to `make-temp-file' as
                the TEXT argument.

:buffer SYMBOL  Open the temporary file using `find-file-noselect'
                and bind SYMBOL to the buffer.  Kill the buffer
                after BODY exits normally or non-locally.

:coding CODING  If non-nil, bind `coding-system-for-write' to CODING
                when executing BODY.  This is handy when STRING includes
                non-ASCII characters or the temporary file must have a
                specific encoding or end-of-line format.

See also `ert-with-temp-directory'.

(fn NAME &rest BODY)
(defalias 'ert-with-temp-file '(macro . #[385 "9\204 \304\305\306\307E\"\210\310\211\211\211\211\211\211\211\311	@\211\262\n!\203\202 A\262	\312\267\202t \211A\262\n\242\262\202 \211A\262\n\242\262\202 \211A\262\n\242\262\202 \211A\262\n\242\262\202 \211A\262\n\242\262\202 \211A\262\n\242\262\202 B\262A\262	\202 \203\220 \313\314\315\316\317#\"\210\320\321!\206\231 \206\252 	\206\252 \322\323 \206\251 \n!\324\303\206\261 D\n\203\274 \325\202\275 \326\327\257DD\203\330 \325D\202\332 D\205\350 \330DDCBBB\331\332B\333	\205\334\n\335BB\336DDB\333\203\337	\340BB\202\341	DDFE\207" [ert-temp-file-prefix ert-temp-file-suffix buffer-file-name coding-system-for-write signal wrong-type-argument symbol name nil keywordp #s(hash-table size 6 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (:prefix 44 :suffix 56 :directory 68 :text 80 :buffer 92 :coding 104)) error "Invalid keywords: %s" mapconcat symbol-name " " make-symbol "temp-file" ert--with-temp-file-generate-suffix macroexp-file-name let* file-name-as-directory identity make-temp-file find-file-literally unwind-protect progn ignore-errors with-current-buffer ((set-buffer-modified-p nil)) kill-buffer delete-directory (:recursive) delete-file] 22 (#$ . 15834)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put ert-with-temp-file lisp-indent-function 1 put edebug-form-spec (symbolp body)] 5)#@438 Bind NAME to the name of a new temporary directory and evaluate BODY.
Delete the temporary directory after BODY exits normally or
non-locally.

NAME is bound to the directory name, not the directory file
name.  (In other words, it will end with the directory delimiter;
on Unix-like systems, it will end with "/".)

The same keyword arguments are supported as in
`ert-with-temp-file' (which see), except for :text.

(fn NAME &rest BODY)
(defalias 'ert-with-temp-directory '(macro . #[385 "\211\300\301@\211\262!\203 AA\262\211\302=\203 \303\304!\210\202 \266\305\306\307BBBB\207" [nil keywordp :text error "Invalid keyword for directory: :text" ert-with-temp-file :directory t] 7 (#$ . 18693)]))
(byte-code "\300\301\302\303#\304\301\305\306#\207" [function-put ert-with-temp-directory lisp-indent-function 1 put edebug-form-spec (symbolp body)] 5)#@71 Return non-nil if the `gcc' command actually runs the Clang compiler.
(defalias 'ert-gcc-is-clang-p #[0 "\300\301\302\303!\"\207" [string-match "Apple \\(LLVM\\|[Cc]lang\\)\\|Xcode\\.app" shell-command-to-string "gcc --version"] 4 (#$ . 19557)])
(byte-code "\301\302!\203 \303\304!\203 \305>\203 \210\202 \305B\301\207" [tramp-remote-path featurep tramp getenv "EMACS_HYDRA_CI" tramp-own-remote-path] 2)#@44 Temporary directory for remote file tests.
(defconst ert-remote-temporary-file-directory (byte-code "\306\307!\205L \310\311!\206L \312=\203 	\207\313\n\235\203 \n\210\202# \313\nB\314\315\316 E\211\235\2034 \266\2029 \211B\210\f\203H \317\320!\204H \321\322\"\210\323\324\"\207" [system-type null-device tramp-methods tramp-default-host-alist noninteractive temporary-file-directory featurep tramp getenv "REMOTE_TEMPORARY_FILE_DIRECTORY" windows-nt ("mock" (tramp-login-program "sh") (tramp-login-args (("-i"))) (tramp-direct-async ("-c")) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-connection-timeout 10)) "\\`mock\\'" nil system-name file-directory-p "~/" setenv "HOME" format "/mock::%s"] 3) (#$ . 19974))
(provide 'ert-x)
