|
11 | 11 | (elpy-folding-toggle-at-point)
|
12 | 12 | (let* ((overlays (apply 'nconc (overlay-lists)))
|
13 | 13 | overlay)
|
14 |
| - (should (= 2 (length overlays))) |
15 |
| - (setq overlay (nth 0 overlays)) |
| 14 | + (setq overlay (elpy-get-overlay-at 25 'code)) |
| 15 | + (should overlay) |
16 | 16 | (should (eq (overlay-get overlay 'hs) 'code))
|
17 | 17 | (should (= (overlay-start overlay) 25))
|
18 | 18 | (should (or (= (overlay-end overlay) 37)
|
19 | 19 | (= (overlay-end overlay) 38))))
|
20 | 20 | (should (= (point) 14))
|
21 | 21 | ;; Unfold
|
22 | 22 | (elpy-folding-toggle-at-point)
|
23 |
| - (let* ((overlays (apply 'nconc (overlay-lists))) |
24 |
| - overlay) |
25 |
| - (should (= 1 (length overlays)))) |
26 | 23 | ;; Position
|
27 | 24 | (should (= (point) 14))))
|
28 | 25 |
|
|
39 | 36 | (elpy-folding-toggle-at-point)
|
40 | 37 | (let* ((overlays (apply 'nconc (overlay-lists)))
|
41 | 38 | overlay)
|
42 |
| - (should (= 2 (length overlays))) |
43 |
| - (setq overlay (nth 0 overlays)) |
| 39 | + (setq overlay (elpy-get-overlay-at 25 'code)) |
| 40 | + (should overlay) |
44 | 41 | (should (eq (overlay-get overlay 'hs) 'code))
|
45 | 42 | (should (= (overlay-start overlay) 25))
|
46 | 43 | (should (or (= (overlay-end overlay) 37)
|
47 | 44 | (= (overlay-end overlay) 38))))
|
48 | 45 | (should (= (point) 14))
|
49 | 46 | ;; Unfold
|
50 | 47 | (elpy-folding-toggle-at-point)
|
51 |
| - (let* ((overlays (apply 'nconc (overlay-lists))) |
52 |
| - overlay) |
53 |
| - (should (= 1 (length overlays)))) |
54 | 48 | ;; Position
|
55 | 49 | (should (= (point) 14))))
|
56 | 50 |
|
|
67 | 61 | (python-mode)
|
68 | 62 | (elpy-mode)
|
69 | 63 | (elpy-folding-toggle-at-point)
|
70 |
| - (let ((overlays (apply 'nconc (overlay-lists)))) |
71 |
| - (should (= 1 (length overlays)))) |
72 | 64 | ;; Position
|
73 | 65 | (should (= (point) 49))))
|
74 | 66 |
|
|
89 | 81 | (elpy-folding-toggle-at-point)
|
90 | 82 | (let* ((overlays (apply 'nconc (overlay-lists)))
|
91 | 83 | overlay)
|
92 |
| - (should (= 3 (length overlays))) |
93 |
| - (setq overlay (nth 0 overlays)) |
| 84 | + (setq overlay (elpy-get-overlay-at 54 'code)) |
| 85 | + (should overlay) |
94 | 86 | (should (eq (overlay-get overlay 'hs) 'code))
|
95 | 87 | (should (= (overlay-start overlay) 54))
|
96 | 88 | (should (or (= (overlay-end overlay) 100)
|
97 | 89 | (= (overlay-end overlay) 101))))
|
98 | 90 | (should (= (point) 43))
|
99 | 91 | ;; Unfold
|
100 | 92 | (elpy-folding-toggle-at-point)
|
101 |
| - (let* ((overlays (apply 'nconc (overlay-lists))) |
102 |
| - overlay) |
103 |
| - (should (= 2 (length overlays)))) |
104 | 93 | ;; Position
|
105 | 94 | (should (= (point) 43))))
|
106 | 95 |
|
|
123 | 112 | (elpy-folding-toggle-at-point)
|
124 | 113 | (let* ((overlays (apply 'nconc (overlay-lists)))
|
125 | 114 | overlay)
|
126 |
| - (should (= 4 (length overlays))) |
127 |
| - (setq overlay (nth 0 overlays)) |
| 115 | + (setq overlay (elpy-get-overlay-at 104 'code)) |
| 116 | + (should overlay) |
128 | 117 | (should (eq (overlay-get overlay 'hs) 'code))
|
129 | 118 | (should (= (overlay-start overlay) 104))
|
130 | 119 | (should (or (= (overlay-end overlay) 150)
|
131 | 120 | (= (overlay-end overlay) 151))))
|
132 | 121 | (should (= (point) 93))
|
133 | 122 | ;; Unfold
|
134 | 123 | (elpy-folding-toggle-at-point)
|
135 |
| - (let* ((overlays (apply 'nconc (overlay-lists))) |
136 |
| - overlay) |
137 |
| - (should (= 3 (length overlays)))) |
138 | 124 | ;; Position
|
139 | 125 | (should (= (point) 93))))
|
140 | 126 |
|
|
157 | 143 | (elpy-folding-toggle-at-point)
|
158 | 144 | (let* ((overlays (apply 'nconc (overlay-lists)))
|
159 | 145 | overlay)
|
160 |
| - (should (= 4 (length overlays))) |
161 |
| - (setq overlay (nth 0 overlays)) |
| 146 | + (setq overlay (elpy-get-overlay-at 29 'code)) |
| 147 | + (should overlay) |
162 | 148 | (should (eq (overlay-get overlay 'hs) 'code))
|
163 | 149 | (should (= (overlay-start overlay) 29))
|
164 | 150 | (should (or (= (overlay-end overlay) 150)
|
165 | 151 | (= (overlay-end overlay) 151))))
|
166 | 152 | (should (= (point) 16))
|
167 | 153 | ;; Unfold
|
168 | 154 | (elpy-folding-toggle-at-point)
|
169 |
| - (let* ((overlays (apply 'nconc (overlay-lists))) |
170 |
| - overlay) |
171 |
| - (should (= 3 (length overlays)))) |
172 | 155 | ;; Position
|
173 | 156 | (should (= (point) 16))))
|
0 commit comments