Fixing an innoculous test case failure I introduced, by override the platform's time zone.

Relaxing the contract on date->string to accord with previous documentation.

Changing web-server example to use more restrictive contract

Please include in 5.0
This commit is contained in:
Jay McCarthy 2010-05-25 06:54:28 -06:00
parent 3885ba4f54
commit 50fd0278ba
3 changed files with 5 additions and 3 deletions

View File

@ -8,7 +8,7 @@
(provide/contract
[current-date (-> date?)]
[date->seconds (date? . -> . exact-integer?)]
[date->string ((date?) (boolean?) . ->* . string?)]
[date->string ((date?) (any/c) . ->* . string?)]
[date-display-format (parameter/c (symbols 'american 'chinese 'german 'indian 'irish 'julian 'iso-8601 'rfc2822))]
[find-seconds ((integer-in 0 61)
(integer-in 0 59)

View File

@ -21,7 +21,9 @@
; date->string
(let* ([secs (find-seconds 1 2 3 4 5 2006)]
[d (seconds->date secs)])
[d-some-tz (seconds->date secs)]
[d (struct-copy date d-some-tz
[time-zone-offset -21600])])
(define (test-string fmt time? result)
(test (parameterize ([date-display-format fmt])
(date->string d time?))

View File

@ -4,7 +4,7 @@
(define interface-version 'v1)
(define timeout +inf.0)
(define count 0)
(define a-date (date->string (seconds->date (current-seconds)) 'time-too))
(define a-date (date->string (seconds->date (current-seconds)) #t))
(define (start initial-request)
(define other-count 0)