tests for Xexpr readers
This commit is contained in:
parent
d5b14eb225
commit
f3444c7e51
|
@ -0,0 +1,10 @@
|
|||
<ul>
|
||||
<li> <word text="hello" /> </li>
|
||||
<li> <ul>
|
||||
<li> <word text="one" /> </li>
|
||||
<li> <word text="two" /> </li>
|
||||
</ul>
|
||||
</li>
|
||||
<li> <word text="world" /></li>
|
||||
<li> <word text="good" /> <word text="bye" /> </li>
|
||||
</ul>
|
|
@ -0,0 +1,5 @@
|
|||
<machine initial="red">
|
||||
<action state="red" next="green" />
|
||||
<action state="green" next="yellow" />
|
||||
<action state="yellow" next="red" />
|
||||
</machine>
|
31
pkgs/htdp-pkgs/htdp-lib/2htdp/tests/batch-io-xexpr.rkt
Normal file
31
pkgs/htdp-pkgs/htdp-lib/2htdp/tests/batch-io-xexpr.rkt
Normal file
|
@ -0,0 +1,31 @@
|
|||
#lang racket
|
||||
|
||||
(require 2htdp/batch-io rackunit)
|
||||
|
||||
(define url "http://www.ccs.neu.edu/home/matthias/HtDP2e/Files/")
|
||||
|
||||
(define local-machine-configuration "batch-io-xexpr-machine.xml")
|
||||
(define remote-machine-configuration (string-append url "machine-configuration.xml"))
|
||||
|
||||
(check-true (url-exists? remote-machine-configuration))
|
||||
|
||||
(define xm0 (read-plain-xexpr local-machine-configuration))
|
||||
(define xm1 (read-xexpr local-machine-configuration))
|
||||
(define rxm0 (read-plain-xexpr/web remote-machine-configuration))
|
||||
(define rxm1 (read-xexpr/web remote-machine-configuration))
|
||||
|
||||
(check-equal? xm0 rxm0 "compare remote and local machine config, plain XML")
|
||||
(check-equal? xm1 rxm1 "compare remote and local machine config, XML with white space")
|
||||
|
||||
(define local-enumeration "batch-io-xexpr-enumeration.xml")
|
||||
(define remote-enumeration (string-append url "enumeration.xml"))
|
||||
|
||||
(check-true (url-exists? remote-enumeration))
|
||||
|
||||
(define en0 (read-plain-xexpr local-enumeration))
|
||||
(define en1 (read-xexpr local-enumeration))
|
||||
(define ren0 (read-plain-xexpr/web remote-enumeration))
|
||||
(define ren1 (read-xexpr/web remote-enumeration))
|
||||
|
||||
(check-equal? xm0 rxm0 "compare remote and local enumeration, plain XML")
|
||||
(check-equal? xm1 rxm1 "compare remote and local enumeration, XML with white space")
|
Loading…
Reference in New Issue
Block a user