generated from jackfirth/racket-package-template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also, fix `in-syntax-identifiers` to skip quoted identifiers.
- Loading branch information
Showing
4 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#lang resyntax/testing/refactoring-test | ||
|
||
|
||
require: resyntax/default-recommendations console-io-suggestions | ||
|
||
|
||
header: | ||
- #lang racket/base | ||
|
||
|
||
test: "should suggest 'any linemode with read-line when linemode not specified" | ||
---------------------------------------- | ||
(define (foo in) | ||
(read-line in)) | ||
---------------------------------------- | ||
---------------------------------------- | ||
(define (foo in) | ||
(read-line in 'any)) | ||
---------------------------------------- | ||
|
||
|
||
test: "should suggest 'any linemode with read-line when linemode and port not specified" | ||
---------------------------------------- | ||
(define (foo) | ||
(read-line)) | ||
---------------------------------------- | ||
---------------------------------------- | ||
(define (foo) | ||
(read-line (current-input-port) 'any)) | ||
---------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#lang racket/base | ||
|
||
|
||
(require racket/contract/base) | ||
|
||
|
||
(provide | ||
(contract-out | ||
[console-io-suggestions refactoring-suite?])) | ||
|
||
|
||
(require racket/file | ||
racket/list | ||
rebellion/private/static-name | ||
resyntax/base | ||
syntax/parse) | ||
|
||
|
||
;@---------------------------------------------------------------------------------------------------- | ||
|
||
|
||
(define-refactoring-rule read-line-any | ||
#:description | ||
(string-append "Specify a line mode of `'any` with `read-line` to avoid differences between " | ||
"Windows and other platforms.") | ||
#:literals (read-line) | ||
(read-line (~optional port)) | ||
(read-line (~? port (current-input-port)) 'any)) | ||
|
||
|
||
(define-refactoring-suite console-io-suggestions | ||
#:rules (read-line-any)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters