prep for 308.1

svn: r2335
This commit is contained in:
Matthew Flatt 2006-03-01 00:52:08 +00:00
parent 1b1cc3f781
commit 0e1e6b18e4
3 changed files with 76 additions and 14 deletions

View File

@ -350,11 +350,11 @@
(set! v #f)
(let loop ()
(err/rt-test (sync/timeout 0
(nack-guard-evt (lambda (nack)
(set! v nack)
(make-semaphore)))
(nack-guard-evt (lambda (nack)
(/ 1 0))))
(nack-guard-evt (lambda (nack)
(set! v nack)
(make-semaphore)))
(nack-guard-evt (lambda (nack)
(/ 1 0))))
exn:fail:contract:divide-by-zero?)
(if v
(test #t nack-try-wait? v)
@ -362,11 +362,11 @@
(set! v #f)
(let loop ()
(err/rt-test (sync/timeout 0
(nack-guard-evt (lambda (nack)
(/ 10 0)))
(nack-guard-evt (lambda (nack)
(set! v nack)
(make-semaphore))))
(nack-guard-evt (lambda (nack)
(/ 10 0)))
(nack-guard-evt (lambda (nack)
(set! v nack)
(make-semaphore))))
exn:fail:contract:divide-by-zero?)
(if v
(begin
@ -376,11 +376,11 @@
(set! v null)
(test #f sync/timeout 0
(nack-guard-evt (lambda (nack)
(set! v (cons nack v))
(make-semaphore)))
(set! v (cons nack v))
(make-semaphore)))
(nack-guard-evt (lambda (nack)
(set! v (cons nack v))
(make-semaphore))))
(set! v (cons nack v))
(make-semaphore))))
(test '(#t #t) map nack-try-wait? v)
;; Check that thread kill also implies nack:

View File

@ -0,0 +1,59 @@
(require (lib "string.ss"))
(load-relative "loadtest.ss")
(define (parse-string m)
(let ([s (regexp-split #rx" +" m)])
(apply string (map (lambda (x) (integer->char
(string->number
(bytes->string/latin-1 x)
16)))
s))))
(printf "Reading tests...\n")
(define test-strings
(with-input-from-file (build-path (current-load-relative-directory)
"NormalizationTest.txt")
(lambda ()
(let loop ([a null])
(let ([l (read-line)])
(if (eof-object? l)
a
(let ([m (regexp-match #rx#"^([0-9A-F ]+);([0-9A-F ]+);([0-9A-F ]+);([0-9A-F ]+);([0-9A-F ]+)" l)])
(if m
(loop (cons (cons l (map parse-string (cdr m)))
a))
(loop a)))))))))
(for-each (lambda (l)
(let-values ([(t c1 c2 c3 c4 c5) (apply values l)])
(printf "Checking ~a\n" t)
(test c2 string-normalize-nfc c1)
(test c2 string-normalize-nfc c2)
(test c2 string-normalize-nfc c3)
(test c4 string-normalize-nfc c4)
(test c4 string-normalize-nfc c5)
(test c3 string-normalize-nfd c1)
(test c3 string-normalize-nfd c2)
(test c3 string-normalize-nfd c3)
(test c5 string-normalize-nfd c4)
(test c5 string-normalize-nfd c5)
(test c4 string-normalize-nfkc c1)
(test c4 string-normalize-nfkc c2)
(test c4 string-normalize-nfkc c3)
(test c4 string-normalize-nfkc c4)
(test c4 string-normalize-nfkc c5)
(test c5 string-normalize-nfkd c1)
(test c5 string-normalize-nfkd c2)
(test c5 string-normalize-nfkd c3)
(test c5 string-normalize-nfkd c4)
(test c5 string-normalize-nfkd c5)))
test-strings)
(report-errs)

View File

@ -1,4 +1,7 @@
Version 301.8
Added string-normalize-nf[k]{d,c}
Version 301.7
Inside MzScheme: added scheme_make_prim_closure_w_arity(), etc.