File tree 2 files changed +25
-9
lines changed
2 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 247
247
248
248
(clojure-unwind '(4 )))
249
249
250
+ (when-refactoring-it " should unwind correctly when multiple ->> are present on same line"
251
+ " (->> 1 inc) (->> [1 2 3 4 5]
252
+ (filter even?)
253
+ (map square))"
254
+
255
+ " (->> 1 inc) (->> (map square (filter even? [1 2 3 4 5])))"
256
+
257
+ (clojure-unwind)
258
+ (clojure-unwind))
259
+
250
260
(when-refactoring-it " should unwind with function name"
251
261
" (->> [1 2 3 4 5]
252
262
sum
299
309
300
310
(when-refactoring-it " should unwind some->>"
301
311
" (some->> :b
302
- (find {:a 1})
303
- val
312
+ (find {:a 1}) val
304
313
(+ 5))"
305
314
306
315
" (some->> (+ 5 (val (find {:a 1} :b))))"
Original file line number Diff line number Diff line change 31
31
(wrong))"
32
32
; ; make this use the native beginning of defun since this is used to
33
33
; ; determine whether to use the comment aware version or not.
34
+ (expect (let ((beginning-of-defun-function nil ))
35
+ (clojure-top-level-form-p " comment" )))))
36
+ (it " should return true when multiple forms are present"
37
+ (with-clojure-buffer-point
38
+ " (+ 1 2) (comment
39
+ (wrong)
40
+ (rig|ht)
41
+ (wrong))"
34
42
(expect (let ((beginning-of-defun-function nil ))
35
43
(clojure-top-level-form-p " comment" ))))))
36
44
37
45
(describe " clojure-beginning-of-defun-function"
38
46
(it " should go to top level form"
39
47
(with-clojure-buffer-point
40
- " (comment
48
+ " (comment
41
49
(wrong)
42
50
(wrong)
43
51
(rig|ht)
44
52
(wrong))"
45
- (beginning-of-defun )
53
+ (clojure- beginning-of-defun-function )
46
54
(expect (looking-at-p " (comment" ))))
47
55
48
56
(it " should eval top level forms inside comment forms when clojure-toplevel-inside-comment-form set to true"
49
57
(with-clojure-buffer-point
50
- " (comment
51
- (wrong)
58
+ " (+ inc 1) (comment
52
59
(wrong)
53
- (rig|ht)
60
+ (wrong) ( rig|ht)
54
61
(wrong))"
55
62
(let ((clojure-toplevel-inside-comment-form t ))
56
- (beginning-of-defun ))
57
- (expect (looking-at-p " [[:space:]]* (right)" ))))
63
+ (clojure- beginning-of-defun-function ))
64
+ (expect (looking-at-p " (right)" ))))
58
65
59
66
(it " should go to beginning of previous top level form"
60
67
(with-clojure-buffer-point
You can’t perform that action at this time.
0 commit comments