summaryrefslogtreecommitdiff
path: root/text_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'text_test.go')
-rwxr-xr-xtext_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/text_test.go b/text_test.go
new file mode 100755
index 0000000..3ec30af
--- /dev/null
+++ b/text_test.go
@@ -0,0 +1,39 @@
+package main
+
+import "testing"
+
+func TestHtml(t *testing.T) {
+ in :=
+ `> we start with a quote
+
+A comment. I liked it.
+
+> feature one
+> feature two
+> feature three
+
+nice!
+`
+
+ out := `<blockquote>we start with a quote</blockquote>
+<p>A comment. I liked it.
+<p><blockquote>feature one<br>
+feature two<br>
+feature three</blockquote>
+<p>nice!`
+ rv := string(htmlify(in))
+ if rv != out {
+ t.Errorf("failure.\nresult: %s\nexpected: %s\n", rv, out)
+ }
+
+ in = `> one quote
+
+> two quote`
+ out = `<blockquote>one quote</blockquote>
+<p><blockquote>two quote</blockquote>`
+
+ rv = string(htmlify(in))
+ if rv != out {
+ t.Errorf("failure.\nresult: %s\nexpected: %s\n", rv, out)
+ }
+}