Fast Link Checker for Markdown and HTML in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
396 B

package main
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestListDirectory(t *testing.T) {
fc := make(chan string, 1024)
err := listDirectory(".", fc)
close(fc)
assert.Equal(t, nil, err)
assert.NotEqual(t, 0, len(fc))
for f := range fc {
i, err := os.Stat(f)
assert.True(t, isMarkupFile(f))
assert.Equal(t, nil, err)
assert.False(t, i.IsDir())
}
}