branch: elpa/flycheck
commit 2ec4be59cf77d8b29020da6e0823e5362c01ef6b
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Add spec and changelog for the ghc -x fix [#2174]
---
CHANGES.rst | 2 ++
test/specs/languages/test-haskell.el | 15 +++++++++++++++
2 files changed, 17 insertions(+)
diff --git a/CHANGES.rst b/CHANGES.rst
index d133ec23f2..251a583f17 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -4,6 +4,8 @@
- Drop support for Emacs 27; Flycheck now requires Emacs 28.1 or newer.
- [#2161]: Fix the ``org-lint`` checker erroring out on Emacs 31, where
``org-lint`` reports line numbers as strings.
+- [#2174]: Fix the ``haskell-ghc`` and ``haskell-stack-ghc`` checkers
+ passing a broken ``-x`` flag in ``haskell-ts-mode``.
- [#2177]: Avoid ``\N{...}`` character escapes, which break native
compilation on Emacs 32.
- Add ``asciidoc-mode`` support to the ``asciidoctor`` and ``textlint``
diff --git a/test/specs/languages/test-haskell.el
b/test/specs/languages/test-haskell.el
index 65faf74284..6cd33b6472 100644
--- a/test/specs/languages/test-haskell.el
+++ b/test/specs/languages/test-haskell.el
@@ -53,6 +53,21 @@
:to-match-with-group "module Hello.World(hello) where"
1 "Hello.World")))
+ (describe "GHC language flag"
+ (it "defaults -x to hs in non-literate modes"
+ (flycheck-buttercup-with-temp-buffer
+ (setq major-mode 'haskell-ts-mode)
+ (let ((args (flycheck-checker-substituted-arguments 'haskell-ghc)))
+ (expect (cadr (member "-x" args)) :to-equal "hs"))
+ (flycheck-safe-delete-temporaries)))
+
+ (it "passes -x lhs in haskell-literate-mode"
+ (flycheck-buttercup-with-temp-buffer
+ (setq major-mode 'haskell-literate-mode)
+ (let ((args (flycheck-checker-substituted-arguments 'haskell-ghc)))
+ (expect (cadr (member "-x" args)) :to-equal "lhs"))
+ (flycheck-safe-delete-temporaries))))
+
(describe "Checker tests"
(flycheck-buttercup-def-checker-test haskell-stack-ghc haskell syntax-error
(assume (file-exists-p (getenv "HOME")))