Skip to content

Commit

Permalink
Add some more tests (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aiden Scandella committed Nov 10, 2016
1 parent 65a773e commit 6cce7d6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions render/godoc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,29 @@ import (
"bytes"
"testing"

"github.com/russross/blackfriday"
"github.com/stretchr/testify/assert"
)

func TestGodocCTor(t *testing.T) {
g := Godoc("mypkg")
assert.Equal(t, "mypkg", g.(*GodocRenderer).pkg)
}

func TestRender_OK(t *testing.T) {
g := Godoc("mypkg")
ast := &blackfriday.Node{
Type: blackfriday.Text,
Literal: []byte("hello"),
}

bs := g.Render(ast)
assert.Equal(t,
"/*\nPackage mypkg is the hello*/\npackage mypkg\n",
string(bs),
)
}

func TestDocumentHeader(t *testing.T) {
out := &bytes.Buffer{}
g := &GodocRenderer{
Expand Down

0 comments on commit 6cce7d6

Please sign in to comment.