Permalink
Browse files

fix infinite tests

  • Loading branch information...
kjk committed Jan 31, 2018
1 parent 8c57d3e commit e0fc813169b926a2182bc6554888eb37d12261f7
Showing with 6 additions and 5 deletions.
  1. +2 −3 fuzz_crashes_test.go
  2. +4 −2 parser/block.go
@@ -28,8 +28,7 @@ func TestCrash1(t *testing.T) {
}
}
// TODO: this enters infinite loop
func NoTestInfinite1(t *testing.T) {
func TestInfinite1(t *testing.T) {
test := "[[[[[[\n\t: ]]]]]]\n\n: " + "\n\n:(()"
c := make(chan bool, 1)
go func() {
@@ -77,7 +76,7 @@ main.main()
go.fuzz.main/main.go:10 +0x2d fp=0xc42049df80 sp=0xc42049df68 pc=0x1118dad
runtime.main()
*/
func NoTestInfinite2(t *testing.T) {
func TestInfinite2(t *testing.T) {
test := ":\x00\x00\x00\x01V\n>* \x00\x80e\n\t* \n\n:\t"
c := make(chan bool, 1)
@@ -244,7 +244,8 @@ func (p *Parser) block(data []byte) {
// anything else must look like a normal paragraph
// note: this finds underlined headings, too
data = data[p.paragraph(data):]
idx := p.paragraph(data)
data = data[idx:]
}
p.nesting--
@@ -1479,7 +1480,8 @@ func (p *Parser) paragraph(data []byte) int {
// did this blank line followed by a definition list item?
if p.extensions&DefinitionLists != 0 {
if i < len(data)-1 && data[i+1] == ':' {
return p.list(data[prev:], ast.ListTypeDefinition)
listLen := p.list(data[prev:], ast.ListTypeDefinition)
return prev + listLen
}
}

0 comments on commit e0fc813

Please sign in to comment.