Fixing problem reported by Nadeem Abdul Hamid
This commit is contained in:
parent
df68ef4deb
commit
f2b5a454bd
29
collects/tests/web-server/pr/bsl.rkt
Normal file
29
collects/tests/web-server/pr/bsl.rkt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#lang racket
|
||||||
|
(require net/url
|
||||||
|
rackunit
|
||||||
|
tests/eli-tester
|
||||||
|
htdp/bsl/reader
|
||||||
|
web-server/servlet/web)
|
||||||
|
(require/expose web-server/servlet/web
|
||||||
|
(embed-ids))
|
||||||
|
(require/expose htdp/bsl/reader
|
||||||
|
(wrap-reader))
|
||||||
|
|
||||||
|
(define base-url
|
||||||
|
(string->url
|
||||||
|
"http://localhost:8000/servlets/standalone.rkt"))
|
||||||
|
(define a-k-url
|
||||||
|
(string->url
|
||||||
|
"http://localhost:8000/servlets/standalone.rkt;((%22k%22%20.%20%22(1%201%2033620206)%22))"))
|
||||||
|
(define k-info
|
||||||
|
'(1 1 33620206))
|
||||||
|
|
||||||
|
(define (can-encode?)
|
||||||
|
(test
|
||||||
|
(continuation-url? a-k-url) => k-info
|
||||||
|
(embed-ids k-info base-url) => (url->string a-k-url)))
|
||||||
|
|
||||||
|
(test
|
||||||
|
(can-encode?)
|
||||||
|
((wrap-reader can-encode? empty)))
|
||||||
|
|
|
@ -23,11 +23,12 @@
|
||||||
;; determine if this url encodes a continuation and extract the instance id and
|
;; determine if this url encodes a continuation and extract the instance id and
|
||||||
;; continuation id.
|
;; continuation id.
|
||||||
(define (continuation-url? a-url)
|
(define (continuation-url? a-url)
|
||||||
(cond
|
(parameterize ([read-accept-dot #t])
|
||||||
[(extract-param a-url "k")
|
(cond
|
||||||
=> read/string]
|
[(extract-param a-url "k")
|
||||||
[else
|
=> read/string]
|
||||||
#f]))
|
[else
|
||||||
|
#f])))
|
||||||
|
|
||||||
(provide/contract
|
(provide/contract
|
||||||
[continuation-url? (url? . -> . (or/c false/c (list/c number? number? number?)))])
|
[continuation-url? (url? . -> . (or/c false/c (list/c number? number? number?)))])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user