The (aux sxml) module

Rendering SXML to HTML

test/math-numbers: pass

(define (test/math-numbers _)
  (⊦= "<math display=\"block\"><mn>3</mn></math>"
      (SXML->HTML->string '((displaymath (m 3)))))
  (⊦= "<math display=\"block\"><mn>3.14</mn></math>"
      (SXML->HTML->string '((displaymath (m 3.14)))))
  (⊦= "<math display=\"block\"><mfrac><mn>1</mn><mn>2</mn></mfrac></math>"
      (SXML->HTML->string '((displaymath (m 1/2)))))
  (⊦= "<math display=\"block\"><mfrac><mn>1</mn><mn>2</mn></mfrac></math>"
      (SXML->HTML->string '((displaymath (frac 1 2)))))
  (⊦= "<math display=\"block\"><mfrac><mi>x</mi><mn>2</mn></mfrac></math>"
      (SXML->HTML->string '((displaymath (frac (m x) 2)))))
  (⊦= "<math display=\"block\"><mrow><mi>x</mi><mi>+</mi><mn>1</mn></mrow></math>"
      (SXML->HTML->string '((displaymath (m (x + 1)))))))
((eta 0.001) (memory #(12582912 1891848 1048576)) (stdout "") (stderr ""))

test/define-vhost: pass

(define (test/define-vhost _)
  (⊦= '(/ "foo") (uri-path (uri-reference "http://example.org/foo")))
  (⊦= 'root (vhost-dispatch vhost 'GET "/"))
  (⊦= '(foo GET) (vhost-dispatch vhost 'GET "/foo"))
  (⊦= '(bar "baz" "1") (vhost-dispatch vhost 'GET "/bar/baz?q=1"))
  (⊦= 'posted (vhost-dispatch vhost 'POST "/foo"))
  (⊦= 'unrouted (vhost-dispatch vhost 'PUT "/foo"))
  (⊦= 'unrouted (vhost-dispatch vhost 'GET "/nope"))
  (⊦= 'unrouted (vhost-dispatch vhost 'GET "/bar/baz/qux"))
  (⊦= 'unrouted (vhost-dispatch vhost 'POST "/")))
((eta 0.0) (memory #(12582912 1894392 1048576)) (stdout "") (stderr ""))