@@ -341,51 +341,91 @@ test: "nested for/and forms can be flattened to a for*/and form"
341341------------------------------
342342
343343
344- test: "(when ...) in a for loop refactored to #:when clause "
344+ test: "(when ...) in a for loop refactored to #:when clause when multiple body forms "
345345------------------------------------------------------------
346346(for ([x (in-list (list 1 2 'a 3 'b 4 ))])
347347 (when (number? x)
348- (displayln x)))
348+ (displayln x)
349+ (displayln (* x 2 ))))
349350============================================================
350351(for ([x (in-list (list 1 2 'a 3 'b 4 ))]
351352 #:when (number? x))
352- (displayln x))
353+ (displayln x)
354+ (displayln (* x 2 )))
353355------------------------------------------------------------
354356
355357
356- test: "(when ...) in a for* loop refactored to #:when clause "
358+ no-change- test: "(when ...) with single body form in a for loop not refactored "
357359------------------------------------------------------------
358- (for* ([x (in-list (list 1 2 'a 3 'b 4 ))])
360+ (for ([x (in-list (list 1 2 'a 3 'b 4 ))])
359361 (when (number? x)
360362 (displayln x)))
363+ ------------------------------------------------------------
364+
365+
366+ test: "(when ...) in a for* loop refactored to #:when clause when multiple body forms "
367+ ------------------------------------------------------------
368+ (for* ([x (in-list (list 1 2 'a 3 'b 4 ))])
369+ (when (number? x)
370+ (displayln x)
371+ (displayln (* x 2 ))))
361372============================================================
362373(for* ([x (in-list (list 1 2 'a 3 'b 4 ))]
363374 #:when (number? x))
364- (displayln x))
375+ (displayln x)
376+ (displayln (* x 2 )))
377+ ------------------------------------------------------------
378+
379+
380+ no-change-test: "(when ...) with single body form in a for* loop not refactored "
381+ ------------------------------------------------------------
382+ (for* ([x (in-list (list 1 2 'a 3 'b 4 ))])
383+ (when (number? x)
384+ (displayln x)))
365385------------------------------------------------------------
366386
367387
368- test: "(unless ...) in a for loop refactored to #:when clause "
388+ test: "(unless ...) in a for loop refactored to #:unless clause when multiple body forms "
369389------------------------------------------------------------
370390(for ([x (in-list (list 1 2 'a 3 'b 4 ))])
371391 (unless (number? x)
372- (displayln x)))
392+ (displayln x)
393+ (displayln "non-number " )))
373394============================================================
374395(for ([x (in-list (list 1 2 'a 3 'b 4 ))]
375396 #:unless (number? x))
376- (displayln x))
397+ (displayln x)
398+ (displayln "non-number " ))
377399------------------------------------------------------------
378400
379401
380- test: "(unless ...) in a for* loop refactored to #:when clause "
402+ no-change- test: "(unless ...) with single body form in a for loop not refactored "
381403------------------------------------------------------------
382- (for* ([x (in-list (list 1 2 'a 3 'b 4 ))])
404+ (for ([x (in-list (list 1 2 'a 3 'b 4 ))])
383405 (unless (number? x)
384406 (displayln x)))
407+ ------------------------------------------------------------
408+
409+
410+ test: "(unless ...) in a for* loop refactored to #:unless clause when multiple body forms "
411+ ------------------------------------------------------------
412+ (for* ([x (in-list (list 1 2 'a 3 'b 4 ))])
413+ (unless (number? x)
414+ (displayln x)
415+ (displayln "non-number " )))
385416============================================================
386417(for* ([x (in-list (list 1 2 'a 3 'b 4 ))]
387418 #:unless (number? x))
388- (displayln x))
419+ (displayln x)
420+ (displayln "non-number " ))
421+ ------------------------------------------------------------
422+
423+
424+ no-change-test: "(unless ...) with single body form in a for* loop not refactored "
425+ ------------------------------------------------------------
426+ (for* ([x (in-list (list 1 2 'a 3 'b 4 ))])
427+ (unless (number? x)
428+ (displayln x)))
389429------------------------------------------------------------
390430
391431
0 commit comments