mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08: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
|
package blackfriday
|
||||||
|
@ -17,7 +17,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func runMarkdown(input string) string {
|
func runReferenceMarkdown(input string) string {
|
||||||
renderer := HtmlRenderer(0)
|
renderer := HtmlRenderer(0)
|
||||||
return string(Markdown([]byte(input), renderer, 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)
|
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 {
|
for _, basename := range files {
|
||||||
fn := filepath.Join("upskirtref", basename+".text")
|
fn := filepath.Join("upskirtref", basename+".text")
|
||||||
actualdata, err := ioutil.ReadFile(fn)
|
actualdata, err := ioutil.ReadFile(fn)
|
||||||
|
@ -43,16 +43,16 @@ func doTests(t *testing.T, files []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
actual := string(actualdata)
|
actual := string(actualdata)
|
||||||
actual = normalizeEol(string(runMarkdown(actual)))
|
actual = normalizeEol(string(runReferenceMarkdown(actual)))
|
||||||
expected := normalizeEol(string(expecteddata))
|
expected := normalizeEol(string(expecteddata))
|
||||||
if actual != expected {
|
if actual != expected {
|
||||||
t.Errorf("\nFile [%#v]\nExpected[%#v]\nActual [%#v]",
|
t.Errorf("\n [%#v]\nExpected[%#v]\nActual [%#v]",
|
||||||
basename+".text", expected, actual)
|
basename+".text", expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCodeSpan(t *testing.T) {
|
func TestReference(t *testing.T) {
|
||||||
files := []string{
|
files := []string{
|
||||||
"Amps and angle encoding",
|
"Amps and angle encoding",
|
||||||
"Auto links",
|
"Auto links",
|
||||||
|
@ -77,5 +77,5 @@ func TestCodeSpan(t *testing.T) {
|
||||||
"Tabs",
|
"Tabs",
|
||||||
"Tidyness",
|
"Tidyness",
|
||||||
}
|
}
|
||||||
doTests(t, files)
|
doFileTests(t, files)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user