Skip to content

Commit

Permalink
Merge ca3c81f into c6a2740
Browse files Browse the repository at this point in the history
  • Loading branch information
czipperz committed Jun 21, 2016
2 parents c6a2740 + ca3c81f commit 9a00e83
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/haskell-decl-scan-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@
(insert-lines "" "fun :: Int -> Int" "fun = id"
"" "f2 :: Int" "f2 = 3" "")
(goto-char (point-max))

(should (haskell-ds-backward-decl))
(should (looking-at-p "f2 :: Int"))

(should (haskell-ds-backward-decl))
(should (looking-at-p "fun :: Int -> Int"))

(should-not (haskell-ds-backward-decl))
(should (= (point-min) (point)))))

Expand All @@ -53,10 +56,13 @@
"" "" "f2 = 3"
"" "" "")
(goto-char (point-max))

(should (haskell-ds-backward-decl))
(should (looking-at-p "f2 :: Int"))

(should (haskell-ds-backward-decl))
(should (looking-at-p "fun :: Int -> Int"))

(should-not (haskell-ds-backward-decl))
(should (= (point-min) (point)))))

Expand All @@ -67,11 +73,14 @@
"" "f2 :: Int" "f2 = 3"
"")
(goto-char (point-min))

(should (haskell-ds-forward-decl))
(should (looking-at-p "$"))
(should (= (point) (save-excursion (goto-line 4) (point))))

(should (haskell-ds-forward-decl))
(should (looking-at-p "f2 :: Int"))

(should (= (point-max) (haskell-ds-forward-decl)))))

(ert-deftest haskell-ds-forward-decl-2 ()
Expand All @@ -83,13 +92,17 @@
"" "" "f2 = 3"
"" "" "")
(goto-char (point-min))

(should (haskell-ds-forward-decl))
(should (looking-at-p "$"))
(should (= (point) (save-excursion (goto-line 7) (point))))

(should (haskell-ds-forward-decl))
(should (looking-at-p "f2 :: Int"))

(should (haskell-ds-forward-decl))
(should (= (point) (save-excursion (goto-line 13) (point))))

(should (= (point-max) (progn (haskell-ds-forward-decl) (point))))))

(provide 'haskell-decl-scan-tests)
Expand Down

0 comments on commit 9a00e83

Please sign in to comment.