From 8c47dbba01c47f26d725420fa49e3812f737ec80 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 11 Nov 2012 20:12:50 -0600 Subject: [PATCH] make the 'failed to click on the radio box' error message more helpful --- collects/framework/test.rkt | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/collects/framework/test.rkt b/collects/framework/test.rkt index 855cac0269..db186405c5 100644 --- a/collects/framework/test.rkt +++ b/collects/framework/test.rkt @@ -424,21 +424,26 @@ ;; entry-matches : string | regexp -> radio-box -> boolean (define (entry-matches name) - (λ (rb) - (let loop ([n (send rb get-number)]) - (cond - [(zero? n) #f] - [else - (let ([itm (send rb get-item-label (- n 1))] - [pln-itm (send rb get-item-plain-label (- n 1))]) - (or (cond - [(string? name) - (or (equal? name itm) - (equal? name pln-itm))] - [(regexp? name) - (or (regexp-match name itm) - (regexp-match name pln-itm))]) - (loop (- n 1))))])))) + (procedure-rename + (λ (rb) + (let loop ([n (send rb get-number)]) + (cond + [(zero? n) #f] + [else + (let ([itm (send rb get-item-label (- n 1))] + [pln-itm (send rb get-item-plain-label (- n 1))]) + (or (cond + [(string? name) + (or (equal? name itm) + (equal? name pln-itm))] + [(regexp? name) + (or (regexp-match name itm) + (regexp-match name pln-itm))]) + (loop (- n 1))))]))) + (string->symbol + (if (regexp? name) + (object-name name) + name)))) ;;; CHOICE