File tree Expand file tree Collapse file tree 1 file changed +28
-13
lines changed Expand file tree Collapse file tree 1 file changed +28
-13
lines changed Original file line number Diff line number Diff line change 2121(require 'purescript-mode )
2222(require 'purescript-indentation )
2323
24+ (defun purescript-test-indentation-expected-only (expected )
25+ (with-temp-buffer
26+ (insert expected)
27+ (purescript-mode)
28+ (turn-on-purescript-indentation)
29+ (indent-region (point-min ) (point-max ))
30+ (should (string= expected (buffer-string )))))
31+
2432(defun purescript-test-indentation (before after &optional start-line )
2533 (with-temp-buffer
2634 (insert before)
@@ -210,15 +218,11 @@ type MyRec = { data :: Number
210218
211219(ert-deftest func-with-do ()
212220 :expected-result :failed
213- (purescript-test-indentation "
221+ (purescript-test-indentation-expected-only "
214222foo :: Foo
215223foo = do
216- pure unit"
217-
218- "
219- foo :: Foo
220- foo = do
221- pure unit" ))
224+ pure unit
225+ " ))
222226
223227(ert-deftest do-bindings ()
224228 :expected-result :failed
@@ -267,14 +271,25 @@ test3 a
267271(ert-deftest comma-first-list-after-case-of ()
268272 " A comma-first list was getting misindented if goes after case-of"
269273 :expected-result :failed
270- (purescript-test-indentation "
274+ (purescript-test-indentation-expected-only "
271275fun = case _ of
272276 [ a
273277 , b ]
274- "
278+ " ))
275279
276- "
277- fun = case _ of
278- [ a
279- , b ]
280+ (ert-deftest multiline-func-decl-arrow-first ()
281+ (purescript-test-indentation-expected-only "
282+ foo ::
283+ ∀ a. A
284+ -> B
285+ -> C
286+ " ))
287+
288+ (ert-deftest multiline-func-decl-arrow-last ()
289+ (purescript-test-indentation-expected-only "
290+ foo ::
291+ ∀ a.
292+ A ->
293+ B ->
294+ C
280295" ))
You can’t perform that action at this time.
0 commit comments