Retry fetching from unicode.org when it fails.

This commit is contained in:
Sam Tobin-Hochstadt 2018-06-22 11:18:32 -04:00
parent eb97c7f54e
commit 30eb06874b

View File

@ -22,11 +22,13 @@
(define path (build-path dir name))
(and (file-exists? path) path))
(let ([path (build-path here name)])
(with-output-to-file path
(lambda ()
(copy-port (get-pure-port (string->url (string-append base name)))
(current-output-port))))
path)))
(define (try)
(with-handlers ([exn:fail? (lambda (x) #f)])
(with-output-to-file path
(lambda ()
(copy-port (get-pure-port (string->url (string-append base name)))
(current-output-port))))))
(and (for/or ([_ 5]) (try)) path))))
(printf "Reading tests...\n")
(define test-strings