Skip to content

Commit 833c1f7

Browse files
Fix 1 occurrence of if-let-to-cond
`cond` with internal definitions is preferred over `if` with `let`, to reduce nesting
1 parent 53abe9c commit 833c1f7

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

typed-racket-test/main.rkt

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -262,20 +262,37 @@
262262
(run-unit-test-suite (or (places) 1))
263263
0))
264264

265-
(if (and (nightly?) (eq? 'cgc (system-type 'gc)))
266-
(printf "Skipping Typed Racket tests.\n")
267-
(let ([to-run (cond [(single) (list (single))]
268-
[else
269-
(append (if (int?) (list (int-tests (excl))) '())
270-
(if (gui?) (list (gui-tests)) '())
271-
(if (external?) (list (external-tests)) '())
272-
(if (opt?) (list (optimization-tests)) '())
273-
(if (missed-opt?) (list (missed-optimization-tests)) '())
274-
(if (bench?) (list (compile-benchmarks)) '())
275-
(if (math?) (list (compile-math)) '()))])])
276-
(unless (and (= unit-test-retcode 0) (= 0 ((exec) to-run)))
277-
(eprintf "Typed Racket Tests did not pass.\n")
278-
(exit 1)))))
265+
(cond
266+
[(and (nightly?) (eq? 'cgc (system-type 'gc))) (printf "Skipping Typed Racket tests.\n")]
267+
[else
268+
(define to-run
269+
(cond
270+
[(single) (list (single))]
271+
[else
272+
(append (if (int?)
273+
(list (int-tests (excl)))
274+
'())
275+
(if (gui?)
276+
(list (gui-tests))
277+
'())
278+
(if (external?)
279+
(list (external-tests))
280+
'())
281+
(if (opt?)
282+
(list (optimization-tests))
283+
'())
284+
(if (missed-opt?)
285+
(list (missed-optimization-tests))
286+
'())
287+
(if (bench?)
288+
(list (compile-benchmarks))
289+
'())
290+
(if (math?)
291+
(list (compile-math))
292+
'()))]))
293+
(unless (and (= unit-test-retcode 0) (= 0 ((exec) to-run)))
294+
(eprintf "Typed Racket Tests did not pass.\n")
295+
(exit 1))]))
279296

280297
;; nightly tests in `run.rkt` for drdr chart continuity
281298
(module test racket/base)

0 commit comments

Comments
 (0)