Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions default-recommendations/boolean-shortcuts-test.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ test: "nested ands interspersed with ors can be flattened"
- (and 1 2 (or 3 4) 5 6)


test: "refactoring an expression doesn't affect formatting of unrefactored code"
----------------------------------------
( displayln "foo" )
(or 1 (or 2 3))
( displayln "bar" )
========================================
( displayln "foo" )
(or 1 2 3)
( displayln "bar" )
----------------------------------------


test: "using if to convert a boolean expression to a boolean can be removed"
- (if (string? "foo") #true #false)
- (string? "foo")
Expand Down
71 changes: 0 additions & 71 deletions default-recommendations/formatting-preservation-test.rkt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,25 @@ no-change-test: "and with more than two arguments should not be refactored"
(and 'some-condition 'another-condition (let ([x 42]) (* x 2)))
------------------------------


test: "cond-let-to-cond-define doesn't reformat the entire cond expression"
----------------------------------------
(define (f c1 c2)
(cond
[c1 ( displayln "foo" )]
[c2
( displayln "bar" )
(let ([x 1])
(* x 2))]
[else ( displayln "else" )]))
========================================
(define (f c1 c2)
(cond
[c1 ( displayln "foo" )]
[c2
( displayln "bar" )
(define x 1)
(* x 2)]
[else ( displayln "else" )]))
----------------------------------------

29 changes: 29 additions & 0 deletions default-recommendations/let-replacement/let-replacement-test.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -625,3 +625,32 @@ test: "let binding with body nested in begin0 extractable to definition and body
(displayln "bar")))
------------------------------


test: "let-to-define doesn't reformat the entire definition context"
----------------------------------------
(define (f)
( displayln "foo" )
(let ([x 1])
(* x 2)))
========================================
(define (f)
( displayln "foo" )
(define x 1)
(* x 2))
----------------------------------------


test: "define-let-to-double-define doesn't reformat the entire definition context"
----------------------------------------
(define (f)
( displayln "foo" )
(define y (let ([x 1]) (* x 2)))
( displayln "bar" ))
========================================
(define (f)
( displayln "foo" )
(define x 1)
(define y (* x 2))
( displayln "bar" ))
----------------------------------------