;ELC
|
;;; Compiled
|
;;; in Emacs version 26.1
|
;;; with all optimizations.
|
|
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
|
|
;;; This file does not contain utf-8 non-ASCII characters,
|
;;; and so can be loaded in Emacs versions earlier than 23.
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
(byte-code "\300\301!\210\300\302!\210\300\303!\207" [require flycheck ert macroexp] 2)
|
#@37 Whether ERT supports test skipping.
|
(defconst flycheck-ert-ert-can-skip (fboundp 'ert-skip) (#$ . 496))
|
(byte-code "\301\302!\204 \303\302\304\"\210\204% \302\305\306\"\210\303\307\310\"\210\303\311\312\313B\"\210\303\314\315\"\210\301\207" [flycheck-ert-ert-can-skip fboundp define-error defalias #[770 "\211\204 \300\262\211:\203 \301\302\303\304\"\"\202 \211\305NB\306\305\307\310B!!#\210\2052 \306\311#\207" [error apply append mapcar #[257 "\211\300N\206 \301\302\"B\207" [error-conditions error "Unknown signal `%s'"] 5 "\n\n(fn PARENT)"] error-conditions put delete-dups copy-sequence error-message] 11 "Define NAME as a new error signal.\nMESSAGE is a string that will be output to the echo area if such an error\nis signaled without being caught by a `condition-case'.\nPARENT is either a signal or a list of signals from which it inherits.\nDefaults to `error'.\n\n(fn NAME MESSAGE &optional PARENT)"] flycheck-ert-skipped "Test skipped" ert-skip #[257 "\300\301\"\207" [signal flycheck-ert-skipped] 4 "\n\n(fn DATA)"] skip-unless macro #[257 "\300\301D\302\303\304DEE\207" [unless ignore-errors signal 'flycheck-ert-skipped quote] 7 "\n\n(fn FORM)"] ert-test-skipped-p #[257 "\301!>\205 \301!>\204 \302\303\304D\"\210\211\305H@\306=\207" [cl-struct-ert-test-failed-tags type-of signal wrong-type-argument ert-test-failed 3 flycheck-ert-skipped] 5 "\n\n(fn RESULT)"]] 4)
|
#@57 The directory to get resources from in this test suite.
|
(defvar flycheck-ert--resource-directory nil (#$ . 1912))
|
#@226 Eval BODY within a temporary buffer.
|
|
Like `with-temp-buffer', but resets the modification state of the
|
temporary buffer to make sure that it is properly killed even if
|
it has a backing file and is modified.
|
|
(fn &rest BODY)
|
(defalias 'flycheck-ert-with-temp-buffer '(macro . #[128 "\300\301\302!\303BBD\207" [with-temp-buffer unwind-protect macroexp-progn ((set-buffer-modified-p nil) (set-visited-file-name nil 'no-query))] 5 (#$ . 2033)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-temp-buffer lisp-indent-function 0] 4)
|
#@159 Create a buffer from FILE-NAME and eval BODY.
|
|
BODY is evaluated with `current-buffer' being a buffer with the
|
contents FILE-NAME.
|
|
(fn FILE-NAME &rest BODY)
|
(defalias 'flycheck-ert-with-file-buffer '(macro . #[385 "\300\301DC\302\303\304\305\306\307BBBBBF\207" [let file-name (unless (file-exists-p file-name) (error "%s does not exist" file-name)) flycheck-ert-with-temp-buffer (insert-file-contents file-name 'visit) (set-visited-file-name file-name 'no-query) (cd (file-name-directory file-name)) (set-buffer-modified-p nil)] 11 (#$ . 2594)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-file-buffer lisp-indent-function 1] 4)
|
#@129 Execute BODY and kill the help buffer afterwards.
|
|
Use this macro to test functions that create a Help buffer.
|
|
(fn &rest BODY)
|
(defalias 'flycheck-ert-with-help-buffer '(macro . #[128 "\300\301!\302BB\207" [unwind-protect macroexp-progn ((when (buffer-live-p (get-buffer (help-buffer))) (kill-buffer (help-buffer))))] 4 (#$ . 3262)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-help-buffer lisp-indent-function 0] 4)
|
#@126 Execute BODY with Global Flycheck Mode enabled.
|
|
After BODY, restore the old state of Global Flycheck Mode.
|
|
(fn &rest BODY)
|
(defalias 'flycheck-ert-with-global-mode '(macro . #[128 "\300\301\302\303\304BB\305BBE\207" [let ((old-state global-flycheck-mode)) unwind-protect progn (global-flycheck-mode 1) ((global-flycheck-mode (if old-state 1 -1)))] 7 (#$ . 3716)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-global-mode lisp-indent-function 0] 4)
|
#@286 Add ENV to `process-environment' in BODY.
|
|
Execute BODY with a `process-environment' which contains all
|
variables from ENV added.
|
|
ENV is an alist, where each cons cell `(VAR . VALUE)' is a
|
environment variable VAR to be added to `process-environment'
|
with VALUE.
|
|
(fn ENV &rest BODY)
|
(defalias 'flycheck-ert-with-env '(macro . #[385 "\300\301\302\303D\304BBBBB\207" [let ((process-environment (copy-sequence process-environment))) pcase-dolist `(,var \, value) ((setenv var value))] 7 (#$ . 4201)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-env lisp-indent-function 1] 4)
|
#@152 Determine the absolute file name of a RESOURCE-FILE.
|
|
Relative file names are expanded against
|
`flycheck-ert--resource-directory'.
|
|
(fn RESOURCE-FILE)
|
(defalias 'flycheck-ert-resource-filename #[257 "\301\"\207" [flycheck-ert--resource-directory expand-file-name] 4 (#$ . 4813)])
|
#@186 Create a temp buffer from a RESOURCE-FILE and execute BODY.
|
|
The absolute file name of RESOURCE-FILE is determined with
|
`flycheck-ert-resource-filename'.
|
|
(fn RESOURCE-FILE &rest BODY)
|
(defalias 'flycheck-ert-with-resource-buffer '(macro . #[385 "\300\301DBB\207" [flycheck-ert-with-file-buffer flycheck-ert-resource-filename] 5 (#$ . 5102)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-resource-buffer lisp-indent-function 1] 4)
|
#@165 Initialize a test suite with RESOURCE-DIR.
|
|
RESOURCE-DIR is the directory, `flycheck-ert-resource-filename'
|
should use to lookup resource files.
|
|
(fn RESOURCE-DIR)
|
(defalias 'flycheck-ert-initialize #[257 "\203 \303\304!\210\305\306\211\"\211\204 \303\307!\210 ?\205W \211\211\205U \211@\310!\n>\2041 \311\312\313D\"\210\211\314H\310!\n>\204C \311\312\313D\"\210\211\314\315\316BBI\266A\266\202\202 \262\207" [flycheck-ert--resource-directory flycheck-ert-ert-can-skip cl-struct-ert-test-tags error "Test suite already initialized" ert-select-tests t "No tests defined. Call `flycheck-ert-initialize' after defining all tests!" type-of signal wrong-type-argument ert-test 5 or ((satisfies ert-test-skipped-p))] 11 (#$ . 5569)])
|
#@963 Define a test case for a syntax CHECKER for LANGUAGE.
|
|
CHECKER is a symbol or a list of symbols denoting syntax checkers
|
being tested by the test. The test case is skipped, if any of
|
these checkers cannot be used. LANGUAGE is a symbol or a list of
|
symbols denoting the programming languages supported by the
|
syntax checkers. This is currently only used for tagging the
|
test appropriately.
|
|
NAME is a symbol denoting the local name of the test. The test
|
itself is ultimately named
|
`flycheck-define-checker/CHECKER/NAME'. If CHECKER is a list,
|
the first checker in the list is used for naming the test.
|
|
Optionally, the keyword arguments `:tags' and `:expected-result'
|
may be given. They have the same meaning as in `ert-deftest.',
|
and are added to the tags and result expectations set up by this
|
macro.
|
|
The remaining forms KEYS-AND-BODY denote the body of the test
|
case, including assertions and setup code.
|
|
(fn CHECKER LANGUAGE NAME &rest KEYS-AND-BODY)
|
(defalias 'flycheck-ert-def-checker-test '(macro . #[899 "\204 \300\301!\210\204 \300\302!\2109\203 C\202 \211@9\203' C\202( \303\304\"\303\305\"\2066 \306\307\310\311#!\312!\211A@@\313\314\315\316\317\316\"\206U \320\321\322\323\322 #D\317\n\321\"E\322\303\324\"\"BBBBBBB\207" [error "No syntax checkers specified" "No languages specified" mapcar #[257 "\300\301\302\"!\207" [intern format "language-%s"] 5 "\n\n(fn L)"] #[257 "\300\301\302\"!\207" [intern format "checker-%s"] 5 "\n\n(fn C)"] default intern format "flycheck-define-checker/%s/%s" ert--parse-keys-and-body (syntax-checker external-tool) ert-deftest nil :expected-result plist-get :passed :tags append quote #[257 "\300\301\302\303\304D\305BBD\306\307\304DDDED\207" [skip-unless or not flycheck-checker-get quote ('command) executable-find flycheck-checker-executable] 8 "\n\n(fn C)"]] 27 (#$ . 6320)]))
|
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-def-checker-test lisp-indent-function 3] 4)
|
#@93 Whether RESULT denotes a timed-out test.
|
|
RESULT is an ERT test result object.
|
|
(fn RESULT)
|
(defalias 'flycheck-ert-syntax-check-timed-out-p #[257 "\301!>\205 \301!>\204 \302\303\304D\"\210\211\305H@\306=\207" [cl-struct-ert-test-failed-tags type-of signal wrong-type-argument ert-test-failed 3 flycheck-ert-syntax-check-timed-out] 5 (#$ . 8309)])
|
#@46 Non-nil if the current checker has finished.
|
(defvar flycheck-ert-syntax-checker-finished nil (#$ . 8670))
|
(byte-code "\300\301!\210\302\303\304\"\207" [make-variable-buffer-local flycheck-ert-syntax-checker-finished add-hook flycheck-after-syntax-check-hook #[0 "\301\211\207" [flycheck-ert-syntax-checker-finished t] 2]] 3)
|
#@161 Time to wait until a checker is finished in seconds.
|
|
After this time has elapsed, the checker is considered to have
|
failed, and the test aborted with failure.
|
(defconst flycheck-ert-checker-wait-time 10 (#$ . 9004))
|
(define-error 'flycheck-ert-syntax-check-timed-out "Syntax check timed out.")
|
#@64 Wait until the syntax check in the current buffer is finished.
|
(defalias 'flycheck-ert-wait-for-syntax-checker #[0 "\302 \204 \302 Z W\203 \303\304!\210\202 \302 Z W\204' \305 \210\306\307\310\"\210\210\310\211\207" [flycheck-ert-syntax-checker-finished flycheck-ert-checker-wait-time float-time sleep-for 1 flycheck-stop signal flycheck-ert-syntax-check-timed-out nil] 4 (#$ . 9305)])
|
#@44 Like `flycheck-buffer', but synchronously.
|
(defalias 'flycheck-ert-buffer-sync #[0 "\303\304C\3051 \306\307 )C0\202 \310\240\210\211@AD\262\311C\303C\312\313\314\315\316$\317\"\320$\216\321\242\"\240)\204D \322\242!\210\266\323 \210\324 \210\325\326!C\303C\312\313\327\315\316\"\330\"\331$\216\n\206g \240)\204q \322\242!\210\266\332C\3331~ \3030\202\211 \310\240\210\211@AD\262\334C\303C\312\313\314\315\316$\335\"\320$\216\321\242\"\240)\203\260 \322\242!\210\266\336 \207" [flycheck-ert-syntax-checker-finished signal-hook-function flycheck-current-syntax-check nil not (error) ert--should-signal-hook flycheck-running-p signal #1=#:ert-form-evaluation-aborted-229 make-byte-code 0 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" vconcat vector [(should (not (flycheck-running-p))) :form eql #1# :value not ert-explainer :explanation apply ert--signal-should-execution] 7 apply ert-fail flycheck-mode flycheck-buffer gensym "ert-form-evaluation-aborted-" "\301\302\303\304\305\300\242\257\240\210\306\301\242!\207" [(should #2=(or flycheck-current-syntax-check flycheck-ert-syntax-checker-finished)) :form #2# :value ert--signal-should-execution] 6 flycheck-deferred-check-p (error) #3=#:ert-form-evaluation-aborted-236 [(should-not (flycheck-deferred-check-p)) :form eql #3# :value flycheck-deferred-check-p ert-explainer :explanation apply ert--signal-should-execution] flycheck-ert-wait-for-syntax-checker] 13 (#$ . 9704)])
|
#@92 Clear the current buffer.
|
|
Raise an assertion error if the buffer is not clear afterwards.
|
(defalias 'flycheck-ert-ensure-clear #[0 "\302 \210\303C\3041 \305 )C0\202 \306\240\210\211@AD\262\307C\310C\311\312\313\314\315$\316\"\317$\216\320\242\"\240)\204D \321\242!\210\266\303C\3221[ \305\323\324\325ed\"\")C0\202f \306\240\210\211@AD\262\326C\310C\311\312\313\314\315$\327\"\317$\216\320\242\"\240)\204\215 \321\242!\210\210\211\242\262\207" [signal-hook-function flycheck-current-errors flycheck-clear not (error) ert--should-signal-hook signal #1=#:ert-form-evaluation-aborted-241 nil make-byte-code 0 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" vconcat vector [(should (not flycheck-current-errors)) :form eql #1# :value not ert-explainer :explanation apply ert--signal-should-execution] 7 apply ert-fail (error) -any\? #[257 "\300\301\"\207" [overlay-get flycheck-overlay] 4 "\n\n(fn OV)"] overlays-in #2=#:ert-form-evaluation-aborted-246 [(should (not (-any\? (lambda (ov) (overlay-get ov 'flycheck-overlay)) (overlays-in (point-min) (point-max))))) :form eql #2# :value not ert-explainer :explanation apply ert--signal-should-execution]] 13 (#$ . 11282)])
|
#@67 Return a copy ERR with the `group' property set to nil.
|
|
(fn ERR)
|
(defalias 'flycheck-error-without-group #[257 "\301!\302!>\204 \303\304\305D\"\210\211\211\306\307I\266\211\207" [cl-struct-flycheck-error-tags copy-flycheck-error type-of signal wrong-type-argument flycheck-error 9 nil] 6 (#$ . 12590)])
|
#@108 Test that ERROR has a proper overlay in the current buffer.
|
|
ERROR is a Flycheck error object.
|
|
(fn ERROR)
|
(defalias 'flycheck-ert-should-overlay #[257 "\302\303\304\305\306\307!\310\"\311\312%\313\314\315 T\"\"\316!\203' e\212eb\210\317 )B\202+ \320\321\"\322!>\204: \323\324\325D\"\210\326H\327!\211\330N\331!\332!\333E\334\335!C\336C\303\314\337\306\307\"\340\"\341$\216\n\240)\204o \342\242!\210\266\343C\3441\202 \345)\346D0\202\215 \323\240\210\211@AD\262\347C\336C\303\314\350\306\307$\351\"\326$\216\352\242\"\240)\204\264 \342\242!\210\266\353C\3541\313 \345\355 !@)D0\202\326 \323\240\210\211@AD\262\356C\336C\303\314\350\306\307$\357\"\326$\216\352\242\"\240)\204\375 \342\242!\210\266\353C\3601\345\361 !A)D0\202\323\240\210\211@AD\262\362C\336C\303\314\350\306\307$\363\"\326$\216\352\242\"\240)\204F\342\242!\210\266\364C\3651\\\345\343 \330\")D0\202g\323\240\210\211@AD\262\366C\336C\303\314\350\306\307$\367\"\326$\216\352\242\"\240)\204\216\342\242!\210\266\370C\3711\250\345\372\314\373\343\f\374\"#)D0\202\263\323\240\210\211@AD\262\375C\336C\303\314\350\306\307$\376\"\326$\216\352\242\"\240)\204\332\342\242!\210\266\364C\3771\363\345\343 \201@ \")D0\202\376\323\240\210\211@AD\262\201A C\336C\303\314\350\306\307$\201B \"\326$\216\352\242\"\240)\204)\342\242!\210\266\370C\201C 1J\345\201D \343\n\325\"!\201D !)D0\202U\323\240\210\211@AD\262\201E C\336C\303\314\350\306\307$\201F \"\326$\216\352\242\"\240)\204\200\342\242!\210\210\211\242\262\266\202\207" [cl-struct-flycheck-error-tags signal-hook-function -first make-byte-code 257 "\301\302\303\"!\301\300!\232\207" vconcat vector [flycheck-error-without-group overlay-get flycheck-error] 5 "\n\n(fn OV)" flycheck-overlays-in 0 buffer-size flycheck-relevant-error-other-file-p point-at-eol flycheck-error-region-for-mode symbols type-of signal wrong-type-argument flycheck-error 7 flycheck-error-level-overlay-category face flycheck-error-level-fringe-bitmap flycheck-error-level-fringe-face left-fringe gensym "ert-form-evaluation-aborted-" nil "\301\302\303\304\305\300\242\257\240\210\306\301\242!\207" [(should overlay) :form overlay :value ert--signal-should-execution] 6 ert-fail overlay-get (error) ert--should-signal-hook flycheck-overlay #1=#:ert-form-evaluation-aborted-253 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" [(should (overlay-get overlay 'flycheck-overlay)) :form eql #1# :value overlay-get ert-explainer :explanation apply ert--signal-should-execution] apply = (error) overlay-start #2=#:ert-form-evaluation-aborted-258 [(should (= (overlay-start overlay) (car region))) :form eql #2# :value = ert-explainer :explanation apply ert--signal-should-execution] (error) overlay-end #3=#:ert-form-evaluation-aborted-263 [(should (= (overlay-end overlay) (cdr region))) :form eql #3# :value = ert-explainer :explanation apply ert--signal-should-execution] eq (error) #4=#:ert-form-evaluation-aborted-268 [(should (eq (overlay-get overlay 'face) face)) :form eql #4# :value eq ert-explainer :explanation apply ert--signal-should-execution] equal (error) get-char-property display before-string #5=#:ert-form-evaluation-aborted-273 [(should (equal (get-char-property 0 'display (overlay-get overlay 'before-string)) fringe-icon)) :form eql #5# :value equal ert-explainer :explanation apply ert--signal-should-execution] (error) category #6=#:ert-form-evaluation-aborted-278 [(should (eq (overlay-get overlay 'category) category)) :form eql #6# :value eq ert-explainer :explanation apply ert--signal-should-execution] (error) flycheck-error-without-group #7=#:ert-form-evaluation-aborted-283 [(should (equal (flycheck-error-without-group (overlay-get overlay 'flycheck-error)) (flycheck-error-without-group error))) :form eql #7# :value equal ert-explainer :explanation apply ert--signal-should-execution]] 22 (#$ . 12907)])
|
#@539 Test that the current buffers has ERRORS.
|
|
ERRORS is a list of errors expected to be present in the current
|
buffer. Each error is given as a list of arguments to
|
`flycheck-error-new-at'.
|
|
If ERRORS are omitted, test that there are no errors at all in
|
the current buffer.
|
|
With ERRORS, test that each error in ERRORS is present in the
|
current buffer, and that the number of errors in the current
|
buffer is equal to the number of given ERRORS. In other words,
|
check that the buffer has all ERRORS, and no other errors.
|
|
(fn &rest ERRORS)
|
(defalias 'flycheck-ert-should-errors #[128 "\302\303\304\305\"\"\306C\3071 \310\302\311\"\302\311 \")D0\202( \312\240\210\211@AD\262\313C\314C\315\316\317\320\321$\322\"\323$\216\304\242\"\240)\204O \324\242!\210\266\325\315\326\327\320\321!\330\"\331\332% #\210\333\334\"\266\335C\3361~ \310G\337ed\"G)D0\202\211 \312\240\210\211@AD\262\340C\314C\315\316\317\320\321$\341\"\323$\216\304\242\"\240)\204\260 \324\242!\210\210\211\242\262\207" [signal-hook-function flycheck-current-errors mapcar apply-partially apply flycheck-error-new-at equal (error) ert--should-signal-hook flycheck-error-without-group signal #1=#:ert-form-evaluation-aborted-288 nil make-byte-code 0 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" vconcat vector [(should (equal (mapcar #'flycheck-error-without-group expected) (mapcar #'flycheck-error-without-group flycheck-current-errors))) :form eql #1# :value equal ert-explainer :explanation apply ert--signal-should-execution] 7 ert-fail cl-mapcar 514 "\302C\3031 \304\305\306\307\300\"\"\305\306\307!\")D0\202& |