test: add a test case triggering an internal bug
This commit is contained in:
parent
46e3fb8ecd
commit
bb8d7d8462
@ -2,6 +2,7 @@ package markdown
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"strings"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -76,3 +77,24 @@ func compareOutput(w *bytes.Buffer, f Formatter, ext string, textPath string, p
|
|||||||
func TestMarkdown103(t *testing.T) {
|
func TestMarkdown103(t *testing.T) {
|
||||||
runDirTests("md1.0.3", t)
|
runDirTests("md1.0.3", t)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This test will make the test run fail with a
|
||||||
|
// message like "Buffer not empty" under the
|
||||||
|
// following condition:
|
||||||
|
//
|
||||||
|
// There exists an unprocessed, remaining portion of the
|
||||||
|
// input buffer after the previous parser call, which
|
||||||
|
// consists only of whitespace.
|
||||||
|
// This whitespace should have been ignored, but, due to
|
||||||
|
// a bug, hasn't.
|
||||||
|
func TestTrailingWhitespaceBug(t *testing.T) {
|
||||||
|
const input = `* foo
|
||||||
|
|
||||||
|
# bar
|
||||||
|
|
||||||
|
* baz
|
||||||
|
`
|
||||||
|
var buf bytes.Buffer
|
||||||
|
p := NewParser(nil)
|
||||||
|
p.Markdown(strings.NewReader(input), ToHTML(&buf))
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user