Skip to content

Guard stack overflow, introduce a test #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 130 additions & 2 deletions tests/haskell-indentation-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,13 @@ because it helps increase coverage."
(should
(equal (cons (list (line-number-at-pos)
(current-column))
(haskell-indentation-find-indentations))
(condition-case condition
(haskell-indentation-find-indentations)
(error
;; for unknown reason Emacs 24.4 ERT does not
;; catch overrun recursion, so we have to
;; catch it here, and throw it again
(signal (car condition) (cdr condition)))))
current))))))

(defmacro hindent-test (name source &rest test-cases)
Expand Down Expand Up @@ -756,7 +762,129 @@ x = asum [ mzero
function = abc
def
xyz"
((3 0) 0 7))
((3 0) 0 7))

(hindent-test "45* phrase should not eat whole stack" "
function =
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
if True
then True
else
"
((118 0) 0 4))


(ert-deftest haskell-indentation-ret-indents ()
Expand Down