2016-07-16 05:03:02 +08:00
|
|
|
//
|
|
|
|
// Blackfriday Markdown Processor
|
|
|
|
// Available at http://github.com/russross/blackfriday
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
//
|
|
|
|
|
|
|
|
package blackfriday
|
|
|
|
|
|
|
|
import "testing"
|
|
|
|
|
|
|
|
func TestDocument(t *testing.T) {
|
2018-09-08 05:47:14 +08:00
|
|
|
t.Parallel()
|
2016-07-16 05:03:02 +08:00
|
|
|
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)
|
|
|
|
}
|