From 2792cd7b5fc201b7fcf10972902002aeb46391d4 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Wed, 20 Mar 2013 19:42:48 -0500 Subject: [PATCH] remove redundant check and minor cleanup --- collects/syntax-color/lexer-contract.rkt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/collects/syntax-color/lexer-contract.rkt b/collects/syntax-color/lexer-contract.rkt index e6d0da4eef..6ddeba7daa 100644 --- a/collects/syntax-color/lexer-contract.rkt +++ b/collects/syntax-color/lexer-contract.rkt @@ -23,10 +23,7 @@ [end (start type) (end/c start type)] [backup exact-nonnegative-integer?] [new-mode any/c]))) - #:tester (λ (lexer) (and (procedure? lexer) - (or (procedure-arity-includes? lexer 1) - (procedure-arity-includes? lexer 3)) - (try-some-random-streams lexer))))) + #:tester (λ (lexer) (try-some-random-streams lexer)))) (define (try-some-random-streams lexer) (define 3ary-lexer @@ -38,8 +35,6 @@ [else lexer])) (for ([x (in-range 10)]) (define size (random 100)) - (define (pick-one . args) - (list-ref args (random (length args)))) (define (quash-backslash-r c) ;; it isn't clear the spec is right in ;; the case of \r\n combinations, so we @@ -50,8 +45,11 @@ (λ (c) (quash-backslash-r (case (random 3) - [(0) (pick-one #\space #\) #\( #\@ #\{ #\} #\" #\λ #\Σ #\nul)] - [(1 2) (integer->char (random 255))]))))) + [(0) + (define s " ()@{}\"λΣ\0") + (string-ref s (random (string-length s)))] + [(1 2) + (integer->char (random 255))]))))) (define in (open-input-string s)) (port-count-lines! in) (let loop ([mode #f][offset 0])