-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
20,644 additions
and
14 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
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 |
---|---|---|
@@ -1,15 +1,32 @@ | ||
;; This file is for regenerating test files | ||
|
||
#lang racket | ||
|
||
(require file/glob) | ||
|
||
(module+ main | ||
(define to-self #;'("conventions.rkt" "core.rkt") | ||
'()) | ||
(define to-out (flatten (map glob '("tests/*.rkt")))) | ||
(define paths '("tests/test-cases/*.rkt" | ||
"tests/benchmarks/*.rkt")) | ||
|
||
(for ([f to-self]) | ||
(system (format "raco fmt -i ~a" (~a f)))) | ||
(define out-ext "out") | ||
|
||
(for ([f to-out]) | ||
(define (regen ext) | ||
(for ([f (flatten (map glob paths))]) | ||
(printf "formatting ~a\n" f) | ||
(system (format "raco fmt ~a > ~a.out" (~a f) (~a f))))) | ||
(system (format "raco fmt ~a > ~a.~a" f f ext)))) | ||
|
||
(module+ main | ||
(regen out-ext)) | ||
|
||
(module+ test | ||
(require rackunit) | ||
|
||
(define-check (check-file f) | ||
(unless (equal? (file->string (format "~a.~a" f check-ext)) | ||
(file->string (format "~a.~a" f out-ext))) | ||
(fail-check (format "Found a mismatch on '~a'" f)))) | ||
|
||
(define check-ext "out-check") | ||
(regen check-ext) | ||
(for ([f (flatten (map glob paths))]) | ||
(check-file f) | ||
(delete-file (format "~a.~a" f check-ext)))) |
Oops, something went wrong.