Making string->xexpr more permissive
This commit is contained in:
parent
103d53f6ad
commit
08a48a67a0
|
@ -481,7 +481,10 @@ END
|
|||
[(define (test-xml->xexpr str xe)
|
||||
(test-equal? str (string->xexpr str) xe))
|
||||
(define (test-xexpr->string xe str)
|
||||
(test-equal? (format "~S" xe) (xexpr->string xe) str))]
|
||||
(test-equal? (format "~S" xe) (xexpr->string xe) str)
|
||||
(test-string->xexpr str xe))
|
||||
(define (test-string->xexpr str xe)
|
||||
(test-equal? str (string->xexpr str) xe))]
|
||||
(test-suite
|
||||
"XML and X-expression Conversions"
|
||||
|
||||
|
@ -519,6 +522,14 @@ END
|
|||
; XXX more xexpr->string tests
|
||||
)
|
||||
|
||||
(test-suite
|
||||
"string->xexpr"
|
||||
(test-string->xexpr "<?foo bar?>\n\n<html /><?foo bar?>\n"
|
||||
'(html ()))
|
||||
(parameterize ([xexpr-drop-empty-attributes #t])
|
||||
(test-string->xexpr "<?foo bar?>\n\n<html /><?foo bar?>\n"
|
||||
'(html))))
|
||||
|
||||
(local
|
||||
[(define (test-eliminate-whitespace tags choose str res)
|
||||
(test-equal? (format "~S" (list tags choose str))
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
(get-output-string port)))
|
||||
|
||||
(define (string->xexpr str)
|
||||
(xml->xexpr (read-xml/element (open-input-string str))))
|
||||
(xml->xexpr (document-element (read-xml (open-input-string str)))))
|
||||
|
||||
;; bcompose : (a a -> c) (b -> a) -> (b b -> c)
|
||||
(define (bcompose f g)
|
||||
|
|
Loading…
Reference in New Issue
Block a user