mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 16:48:14 +00:00
fix test name conflicts
This commit is contained in:
parent
cd5e4957ce
commit
a4339270a5
@ -5,7 +5,7 @@
|
||||
//
|
||||
|
||||
//
|
||||
// Unit tests for inline parsing
|
||||
// Markdown 1.0.3 reference tests
|
||||
//
|
||||
|
||||
package blackfriday
|
||||
@ -17,7 +17,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func runMarkdown(input string) string {
|
||||
func runReferenceMarkdown(input string) string {
|
||||
renderer := HtmlRenderer(0)
|
||||
return string(Markdown([]byte(input), renderer, 0))
|
||||
}
|
||||
@ -27,7 +27,7 @@ func normalizeEol(s string) string {
|
||||
return strings.Replace(s, "\r\n", "\n", -1)
|
||||
}
|
||||
|
||||
func doTests(t *testing.T, files []string) {
|
||||
func doFileTests(t *testing.T, files []string) {
|
||||
for _, basename := range files {
|
||||
fn := filepath.Join("upskirtref", basename+".text")
|
||||
actualdata, err := ioutil.ReadFile(fn)
|
||||
@ -43,16 +43,16 @@ func doTests(t *testing.T, files []string) {
|
||||
}
|
||||
|
||||
actual := string(actualdata)
|
||||
actual = normalizeEol(string(runMarkdown(actual)))
|
||||
actual = normalizeEol(string(runReferenceMarkdown(actual)))
|
||||
expected := normalizeEol(string(expecteddata))
|
||||
if actual != expected {
|
||||
t.Errorf("\nFile [%#v]\nExpected[%#v]\nActual [%#v]",
|
||||
t.Errorf("\n [%#v]\nExpected[%#v]\nActual [%#v]",
|
||||
basename+".text", expected, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCodeSpan(t *testing.T) {
|
||||
func TestReference(t *testing.T) {
|
||||
files := []string{
|
||||
"Amps and angle encoding",
|
||||
"Auto links",
|
||||
@ -77,5 +77,5 @@ func TestCodeSpan(t *testing.T) {
|
||||
"Tabs",
|
||||
"Tidyness",
|
||||
}
|
||||
doTests(t, files)
|
||||
doFileTests(t, files)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user