diff --git a/collects/xml/test.ss b/collects/xml/test.ss index e0f0fc43fa..5d6f27ec58 100644 --- a/collects/xml/test.ss +++ b/collects/xml/test.ss @@ -2,7 +2,8 @@ ;; % mzscheme --require test.ss (module test mzscheme - (require xml/xml + (require xml/main + scheme/list scheme/port) @@ -101,6 +102,35 @@ END result-string expected-string))) + + ;; pis + (define a-pi (make-p-i #f #f "foo" "bar")) + (define a-p (make-prolog empty #f)) + (define a-p/pi (make-prolog (list a-pi) #f)) + (define a-d0 + (make-document a-p (make-element #f #f 'html empty empty) + empty)) + (define a-d1 + (make-document a-p (make-element #f #f 'html empty empty) + (list a-pi))) + (define a-d2 + (make-document a-p/pi (make-element #f #f 'html empty empty) + (list a-pi))) + + (define (test-string=? test result expected) + (unless (string=? result expected) + (report-err test result expected))) + + (test-string=? "Display XML w/o pis" + (with-output-to-string (lambda () (display-xml a-d0))) + "\n") + (test-string=? "Display XML w/ pi in doc-misc" + (with-output-to-string (lambda () (display-xml a-d1))) + "\n\n") + (test-string=? "Display XML w/ pi in doc-misc and prolog" + (with-output-to-string (lambda () (display-xml a-d2))) + "\n\n\n") + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; done