2016-07-15 17:03:02 -04:00
|
|
|
//
|
2018-01-25 13:06:17 -08:00
|
|
|
// Markdown Processor for Go
|
|
|
|
// Available at https://github.com/gomarkdown/markdown
|
2016-07-15 17:03:02 -04:00
|
|
|
//
|
|
|
|
// Copyright © 2011 Russ Ross <russ@russross.com>.
|
|
|
|
// Distributed under the Simplified BSD License.
|
|
|
|
// See README.md for details.
|
|
|
|
//
|
|
|
|
|
|
|
|
//
|
|
|
|
// Unit tests for full document parsing and rendering
|
|
|
|
//
|
|
|
|
|
2018-01-25 13:01:19 -08:00
|
|
|
package markdown
|
2016-07-15 17:03:02 -04:00
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestDocument(t *testing.T) {
|
|
|
|
var tests = []string{
|
|
|
|
// Empty document.
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
|
|
|
|
" ",
|
|
|
|
"",
|
|
|
|
|
|
|
|
// This shouldn't panic.
|
|
|
|
// https://github.com/russross/blackfriday/issues/172
|
|
|
|
"[]:<",
|
|
|
|
"<p>[]:<</p>\n",
|
|
|
|
|
|
|
|
// This shouldn't panic.
|
|
|
|
// https://github.com/russross/blackfriday/issues/173
|
|
|
|
" [",
|
|
|
|
"<p>[</p>\n",
|
|
|
|
}
|
|
|
|
doTests(t, tests)
|
|
|
|
}
|