File tree Expand file tree Collapse file tree 1 file changed +28
-5
lines changed
web-server-test/tests/web-server/private Expand file tree Collapse file tree 1 file changed +28
-5
lines changed Original file line number Diff line number Diff line change 6
6
make-temporary-file)
7
7
web-server/http
8
8
web-server/http/response
9
+ (submod web-server/http/response testing)
9
10
(prefix-in compat0: web-server/compat/0/http/response-structs)
10
11
"../util.rkt " )
11
12
178
179
#"HEAD " )
179
180
#"HTTP/1.1 200 OK\r\nDate: REDACTED GMT\r\nLast-Modified: REDACTED GMT\r\nServer: Racket\r\nContent-Type: text/html; charset=utf-8\r\n\r\n " ))))
180
181
182
+ (define seconds->gmt-bytes-tests
183
+ (test-suite
184
+ "seconds->gmt-bytes "
185
+
186
+ (check-equal?
187
+ (seconds->gmt-bytes 0 )
188
+ #"Thu, 01 Jan 1970 00:00:00 GMT " )
189
+ (check-equal?
190
+ (seconds->gmt-bytes 86400 )
191
+ #"Fri, 02 Jan 1970 00:00:00 GMT " )
192
+ (check-equal?
193
+ (seconds->gmt-bytes (+ 86400 3600 193 ))
194
+ #"Fri, 02 Jan 1970 01:03:13 GMT " )
195
+ (check-equal?
196
+ (seconds->gmt-bytes (+ (* 30 86400 ) 3600 193 ))
197
+ #"Sat, 31 Jan 1970 01:03:13 GMT " )
198
+ (check-equal?
199
+ (seconds->gmt-bytes (+ (* 90 86400 ) (quotient 86400 2 ) 977 ))
200
+ #"Wed, 01 Apr 1970 12:16:17 GMT " )))
201
+
181
202
(define response-tests
182
203
(test-suite
183
204
"HTTP Responses "
184
-
205
+
185
206
output-response-tests
186
-
207
+
187
208
output-response/method-tests
188
-
209
+
210
+ seconds->gmt-bytes-tests
211
+
189
212
(let ()
190
213
(define tmp-file (make-temporary-file))
191
- (with-output-to-file tmp-file
214
+ (with-output-to-file tmp-file
192
215
(lambda ()
193
216
(display
194
- (xexpr->string
217
+ (xexpr->string
195
218
`(html (head (title "A title " ))
196
219
(body "Here's some content! " )))))
197
220
#:exists 'truncate/replace )
You can’t perform that action at this time.
0 commit comments