branch: elpa/julia-mode commit 5d693ab5278d70a4cc1fee9bcd30a57a76f49886 Author: Tamas K. Papp <tkp...@gmail.com> Commit: GitHub <nore...@github.com>
Fix CI using actions. (#160) * Fix CI using actions. Factor out font locking query code. * fix typo * disable linter for now --- .github/workflows/CI.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ julia-mode-tests.el | 28 ++++++++++++++++-------- 2 files changed, 74 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..b372ea0 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,55 @@ +# uses https://github.com/leotaku/elisp-check for CI and +# https://github.com/purcell/setup-emacs for Emacs setup + +name: check + +on: + pull_request: + push: + branches: + - master + - 'releases/*' + +jobs: + check: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + emacs_version: + - 25.1 + - 25.2 + - 25.3 + - 26.1 + - 26.2 + - 26.3 + - 27.1 + - 27.2 + ignore_warnings: + - true + include: + - emacs_version: snapshot + ignore_warnings: false + steps: + - uses: actions/checkout@v2 + - uses: purcell/setup-emacs@master + with: + version: ${{ matrix.emacs_version }} + - name: Run ert + uses: leotaku/elisp-check@master + with: + check: ert + file: 'julia-mode-tests.el' + ignore_warnings: ${{ matrix.ignore_warnings }} + # - name: Run package-lint # FIXME disabled as failing + # uses: leotaku/elisp-check@master + # with: + # file: "julia-mode.el" + # ignore_warnings: true + # check: package-lint + - name: Run byte-compile + uses: leotaku/elisp-check@master + with: + file: "julia-mode.el" + ignore_warnings: true + check: byte-compile diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 9befc9d..bb4af97 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -54,16 +54,20 @@ (should (equal (buffer-substring-no-properties (point-min) (point-max)) ,to))))) -(defmacro julia--should-font-lock (text pos face) - "Assert that TEXT at position POS gets font-locked with FACE in `julia-mode'." - `(with-temp-buffer +(defun julia--get-font-lock (text pos) + "Get the face of `text' at `pos' when font-locked as Julia code in this mode." + (with-temp-buffer (julia-mode) - (insert ,text) + (insert text) (if (fboundp 'font-lock-ensure) (font-lock-ensure (point-min) (point-max)) (with-no-warnings (font-lock-fontify-buffer))) - (should (eq ,face (get-text-property ,pos 'face))))) + (get-text-property pos 'face))) + +(defmacro julia--should-font-lock (text pos face) + "Assert that TEXT at position POS gets font-locked with FACE in `julia-mode'." + `(should (eq ,face (julia--get-font-lock ,text ,pos)))) (defmacro julia--should-move-point (text fun from to &optional end arg) "With TEXT in `julia-mode', after calling FUN, the point should move FROM\ @@ -720,15 +724,21 @@ var = func(begin (julia--should-font-lock s1 10 nil))) (ert-deftest julia--test-char-const-font-lock () - (dolist (c '("'\\''" "'\\\"'" "'\\\\'" "'\\010'" "'\\xfe'" "'\\uabcd'" - "'\\Uabcdef01'" "'\\n'" "'a'" "'z'" "'''")) + (dolist (c '("'\\''" + "'\\\"'" + "'\\\\'" + "'\\010'" + "'\\xfe'" + "'\\uabcd'" + "'\\Uabcdef01'" + "'\\n'" + "'a'" "'z'" "'''")) (let ((c (format " %s " c))) (progn (julia--should-font-lock c 1 nil) (julia--should-font-lock c 2 font-lock-string-face) (julia--should-font-lock c (- (length c) 1) font-lock-string-face) - (julia--should-font-lock c (length c) nil) - )))) + (julia--should-font-lock c (length c) nil))))) ;;; Movement (ert-deftest julia--test-beginning-of-defun-assn-1 ()