mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
add some stderr output to reference stress tests
This commit is contained in:
parent
cd3fa08cb1
commit
ec90dd0fc4
|
@ -14,7 +14,9 @@
|
|||
package blackfriday
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
@ -50,18 +52,21 @@ func doTestsReference(t *testing.T, files []string, flag int) {
|
|||
}
|
||||
expected := string(expectedBytes)
|
||||
|
||||
fmt.Fprintf(os.Stderr, "processing %s ...", filename)
|
||||
actual := string(runMarkdownReference(input, flag))
|
||||
if actual != expected {
|
||||
t.Errorf("\n [%#v]\nExpected[%#v]\nActual [%#v]",
|
||||
basename+".text", expected, actual)
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, " ok\n")
|
||||
|
||||
// now test every prefix of every input to check for
|
||||
// bounds checking
|
||||
if !testing.Short() {
|
||||
start := 0
|
||||
for end := start + 1; end <= len(input); end++ {
|
||||
start, max := 0, len(input)
|
||||
for end := start + 1; end <= max; end++ {
|
||||
candidate = input[start:end]
|
||||
fmt.Fprintf(os.Stderr, " %s %d:%d/%d\n", filename, start, end, max)
|
||||
_ = runMarkdownReference(candidate, flag)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user