(import scheme (chicken base) (chicken port) svnwiki-sxml test) (define (->sxml text) (call-with-input-string text svnwiki->sxml)) (test-begin "Font styles") (test '((p (b "don't"))) (->sxml "'''don't'''")) (test '((p (i "don't"))) (->sxml "''don't''")) (test-end "Font styles") (test-begin "Links") (test '((p "[[]]")) (->sxml "[[]]")) (test '((p (int-link "foo"))) (->sxml "[[foo]]")) (test '((p (int-link "foo"))) (->sxml "[[foo|]]")) (test '((p (int-link "#foo" "foo"))) (->sxml "[[#foo]]")) (test '((p (int-link "#foo" "foo"))) (->sxml "[[#foo|]]")) (test '((p (int-link "/foo"))) (->sxml "[[/foo]]")) (test '((p (link "http://foo"))) (->sxml "[[http://foo]]")) (test '((p (link "http://foo"))) (->sxml "[[http://foo|]]")) (test '((p (link "https://foo"))) (->sxml "[[https://foo]]")) (test '((p (link "ftp://foo"))) (->sxml "[[ftp://foo]]")) (test '((p (link "//foo"))) (->sxml "[[//foo]]")) (test-end "Links") (test-begin "Preformatted blocks") (test '((pre "foo\nbar\nbaz")) (->sxml " foo\n bar\n baz")) (test '((pre "foo\nbar\nbaz\n\nqux\nquux")) (->sxml " foo\n bar\n baz\n \n qux\n quux")) (test '((pre "foo\nbar\nbaz\n\nqux\nquux")) (->sxml " foo\n bar\n baz\n\n qux\n quux")) (test '((pre "foo\nbar\nbaz\n\n\nqux\nquux")) (->sxml " foo\n bar\n baz\n\n\n qux\n quux")) (test-end "Preformatted blocks") (test-exit)