Skip to content

Commit

Permalink
Merge pull request #1368 from czipperz/space-decl-scan-tests
Browse files Browse the repository at this point in the history
Space calls to the function to be tested to enhance readability
  • Loading branch information
gracjan committed Jun 27, 2016
2 parents 5b13550 + ab742f4 commit e7452b4
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 @@ -61,10 +61,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 (bobp))))

Expand Down Expand Up @@ -98,10 +101,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 @@ -112,11 +118,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)))
(should (eobp))))

Expand All @@ -129,13 +138,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))))
(should (eobp))))

Expand Down

0 comments on commit e7452b4

Please sign in to comment.