Skip to content

Commit bf9df35

Browse files
committed
Tests for first column handling.
1 parent 8502179 commit bf9df35

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

tests/haskell-simple-indent-tests.el

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@
2222
(insert line)
2323
(insert "\n"))
2424
;; cursor is at the beginning of the second line now
25-
(let ((result-forward '())
25+
(let ((result-forward '(0))
2626
(result-backward '()))
27-
(dotimes (i 10)
27+
(dotimes (i 9)
2828
(haskell-simple-indent)
2929
(setq result-forward (cons (current-column) result-forward)))
30-
(dotimes (i 10)
30+
(dotimes (i 9)
3131
(setq result-backward (cons (current-column) result-backward))
3232
(haskell-simple-indent-backtab))
33+
(setq result-backward (cons (current-column) result-backward))
3334
(list (reverse result-forward) result-backward))))
3435

3536
(ert-deftest find-indent-positions-1 ()
@@ -64,8 +65,8 @@
6465
"")))))
6566

6667
(ert-deftest find-indent-and-backtab-positions-1 ()
67-
(should (equal '((2 4 5 8 16 24 32 40 48 56)
68-
(2 4 5 8 16 24 32 40 48 56))
68+
(should (equal '((0 2 4 5 8 16 24 32 40 48)
69+
(0 2 4 5 8 16 24 32 40 48))
6970
;; Note: haskell-simple-indent-backtab is broken when
7071
;; it encounters TABs in source file.
7172
(find-indent-and-backtab-positions '("a b c d e f g h"
@@ -74,26 +75,26 @@
7475
(setq indent-tabs-mode nil))))))
7576

7677
(ert-deftest find-indent-and-backtab-positions-1a ()
77-
(should (equal '((2 4 5 8 16 24 32 40 48 56)
78-
(2 4 5 8 16 24 32 40 48 56))
78+
(should (equal '((0 2 4 5 8 16 24 32 40 48)
79+
(0 2 4 5 8 16 24 32 40 48))
7980
(find-indent-and-backtab-positions '("a b c d e f g h"
8081
" long_streak")))))
8182

8283
(ert-deftest find-indent-and-backtab-positions-2 ()
83-
(should (equal '((8 10 13 20 24 27 32 35 37 45)
84-
(8 10 13 20 24 27 32 35 37 45))
84+
(should (equal '((0 8 10 13 20 24 27 32 35 37)
85+
(0 8 10 13 20 24 27 32 35 37))
8586
(find-indent-and-backtab-positions '("\tx <- return 123 {- This is a comment -}")
8687
(lambda ()
8788
(setq-local indent-tabs-mode nil))))))
8889

8990
(ert-deftest find-indent-and-backtab-positions-2a ()
90-
(should (equal '((8 10 13 20 24 27 32 35 37 45)
91-
(8 10 13 20 24 27 32 35 37 45))
91+
(should (equal '((0 8 10 13 20 24 27 32 35 37)
92+
(0 8 10 13 20 24 27 32 35 37))
9293
(find-indent-and-backtab-positions '("\tx <- return 123 {- This is a comment -}")))))
9394

9495
(ert-deftest find-indent-and-backtab-positions-3 ()
95-
(should (equal '((2 4 6 13 15 17 19 24 32 40)
96-
(2 4 6 13 15 17 19 24 32 40))
96+
(should (equal '((0 2 4 6 13 15 17 19 24 32)
97+
(0 2 4 6 13 15 17 19 24 32))
9798
(find-indent-and-backtab-positions '(" f g e e iirelevant"
9899
"a b c d"
99100
" h idden x"
@@ -105,8 +106,8 @@
105106
(setq-local indent-tabs-mode nil))))))
106107

107108
(ert-deftest find-indent-and-backtab-positions-3a ()
108-
(should (equal '((2 4 6 13 15 17 19 24 32 40)
109-
(2 4 6 13 15 17 19 24 32 40))
109+
(should (equal '((0 2 4 6 13 15 17 19 24 32)
110+
(0 2 4 6 13 15 17 19 24 32))
110111
(find-indent-and-backtab-positions '(" f g e e iirelevant"
111112
"a b c d"
112113
" h idden x"

0 commit comments

Comments
 (0)