From b9281c89737419216b710a87c31686d21adf86bc Mon Sep 17 00:00:00 2001 From: Nicolas Sterchele Date: Wed, 31 Aug 2022 23:08:52 +0200 Subject: initial commit Thanks to Ted Unangst for its work. Originally available here https://humungus.tedunangst.com/r/inks --- text_test.go | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 text_test.go (limited to 'text_test.go') 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 := `
we start with a quote
+

A comment. I liked it. +

feature one
+feature two
+feature three
+

nice!` + rv := string(htmlify(in)) + if rv != out { + t.Errorf("failure.\nresult: %s\nexpected: %s\n", rv, out) + } + + in = `> one quote + +> two quote` + out = `

one quote
+

two quote
` + + rv = string(htmlify(in)) + if rv != out { + t.Errorf("failure.\nresult: %s\nexpected: %s\n", rv, out) + } +} -- cgit v1.2.3