branch: elpa/haskell-tng-mode
commit 50b53d397dc28c64b0dce06eb1b9fc63249adb44
Author: Tseen She <[email protected]>
Commit: Tseen She <[email protected]>
tng compilation tests
---
Cask | 1 -
test/haskell-tng-compile-test.el | 23 ++++++++++-------------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/Cask b/Cask
index 7831baf..13a428a 100644
--- a/Cask
+++ b/Cask
@@ -26,7 +26,6 @@
(development
(depends-on "faceup")
- (depends-on "haskell-mode") ;; regression testing
(depends-on "ert-runner")
(depends-on "undercover"))
diff --git a/test/haskell-tng-compile-test.el b/test/haskell-tng-compile-test.el
index fe0e775..8f214cf 100644
--- a/test/haskell-tng-compile-test.el
+++ b/test/haskell-tng-compile-test.el
@@ -7,8 +7,6 @@
(require 'dash)
(require 'faceup)
-(require 'haskell-compile)
-
(require 'haskell-tng-mode)
(require 'haskell-tng-testutils
"test/haskell-tng-testutils.el")
@@ -16,38 +14,37 @@
(defun have-expected-errors (file)
(with-temp-buffer
(let ((output (current-buffer))
- ;; compilation-mode uses font-lock-face, not face
(faceup-default-property 'font-lock-face)
- ;; maybe add compilation-message ?
- ;; maybe add overlays ?
(faceup-properties '(font-lock-face)))
(compilation-start
(format "cat %s" file)
- 'haskell-compilation-mode
+ 'haskell-tng-compilation-mode
(lambda (_) output))
(while compilation-in-progress
(sit-for 0.01))
(haskell-tng-compile:clean-output)
- ;; (font-lock-fontify-region (point-min) (point-max))
- ;; (--dotimes (point-max)
- ;; (let ((p (+ 1 it)))
- ;; (message "POINT=%s PROPS=%S" p (text-properties-at p))))
-
(haskell-tng-testutils:assert-file-contents
file
output
#'buffer-to-faceup-string
"faceup"))))
+;; TODO locally scope this override to this test. Would also be good to
override
+;; abbreviate-file-name and current-time-string
+(defun compilation-handle-exit (_1 _2 _3)
+ "Overrides the default behaviour to remove noise")
+
(defun haskell-tng-compile:clean-output ()
"Removes timestamps and local file paths"
(let ((inhibit-read-only t))
(goto-char (point-min))
(kill-line 4)
- (goto-char (point-max))
- (kill-line -2)))
+ ;; not needed with the custom compilation-handle-exit
+ ;;(goto-char (point-max))
+ ;;(kill-line -2)
+ ))
;; to generate .faceup files, use faceup-view-buffer
(ert-deftest haskell-tng-compile-errors-file-tests ()