forked from mirror/oddmu
The previous revision is the one with HTML and SVG sanitization. I'm removing it because I think the authors are all trusted users and so they produce trusted HTML.
25 lines
452 B
Go
25 lines
452 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"github.com/google/subcommands"
|
|
"github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func TestHtmlCmd(t *testing.T) {
|
|
b := new(bytes.Buffer)
|
|
s := htmlCli(b, false, []string{"index"})
|
|
assert.Equal(t, subcommands.ExitSuccess, s)
|
|
r := `<h1>Welcome to Oddµ</h1>
|
|
|
|
<p>Hello! 🙃</p>
|
|
|
|
<p>Check out the <a href="README">README</a>.</p>
|
|
|
|
<p>Or <a href="test">create a new page</a>.</p>
|
|
|
|
`
|
|
assert.Equal(t, r, b.String())
|
|
}
|