|
22 | 22 | (insert line)
|
23 | 23 | (insert "\n"))
|
24 | 24 | ;; cursor is at the beginning of the second line now
|
25 |
| - (let ((result-forward '()) |
| 25 | + (let ((result-forward '(0)) |
26 | 26 | (result-backward '()))
|
27 |
| - (dotimes (i 10) |
| 27 | + (dotimes (i 9) |
28 | 28 | (haskell-simple-indent)
|
29 | 29 | (setq result-forward (cons (current-column) result-forward)))
|
30 |
| - (dotimes (i 10) |
| 30 | + (dotimes (i 9) |
31 | 31 | (setq result-backward (cons (current-column) result-backward))
|
32 | 32 | (haskell-simple-indent-backtab))
|
| 33 | + (setq result-backward (cons (current-column) result-backward)) |
33 | 34 | (list (reverse result-forward) result-backward))))
|
34 | 35 |
|
35 | 36 | (ert-deftest find-indent-positions-1 ()
|
|
64 | 65 | "")))))
|
65 | 66 |
|
66 | 67 | (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)) |
69 | 70 | ;; Note: haskell-simple-indent-backtab is broken when
|
70 | 71 | ;; it encounters TABs in source file.
|
71 | 72 | (find-indent-and-backtab-positions '("a b c d e f g h"
|
|
74 | 75 | (setq indent-tabs-mode nil))))))
|
75 | 76 |
|
76 | 77 | (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)) |
79 | 80 | (find-indent-and-backtab-positions '("a b c d e f g h"
|
80 | 81 | " long_streak")))))
|
81 | 82 |
|
82 | 83 | (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)) |
85 | 86 | (find-indent-and-backtab-positions '("\tx <- return 123 {- This is a comment -}")
|
86 | 87 | (lambda ()
|
87 | 88 | (setq-local indent-tabs-mode nil))))))
|
88 | 89 |
|
89 | 90 | (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)) |
92 | 93 | (find-indent-and-backtab-positions '("\tx <- return 123 {- This is a comment -}")))))
|
93 | 94 |
|
94 | 95 | (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)) |
97 | 98 | (find-indent-and-backtab-positions '(" f g e e iirelevant"
|
98 | 99 | "a b c d"
|
99 | 100 | " h idden x"
|
|
105 | 106 | (setq-local indent-tabs-mode nil))))))
|
106 | 107 |
|
107 | 108 | (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)) |
110 | 111 | (find-indent-and-backtab-positions '(" f g e e iirelevant"
|
111 | 112 | "a b c d"
|
112 | 113 | " h idden x"
|
|
0 commit comments