Files
oddmu/html_cmd_test.go
2025-12-06 13:38:46 +01:00

26 lines
507 B
Go

package main
import (
"bytes"
"testing"
"github.com/google/subcommands"
"github.com/stretchr/testify/assert"
)
func TestHtmlCmd(t *testing.T) {
b := new(bytes.Buffer)
s := htmlCli(b, "", []string{"index.md"})
assert.Equal(t, subcommands.ExitSuccess, s)
r := `<h1 id="welcome-to-oddμ">Welcome to Oddμ</h1>
<p>Hello! 🙃</p>
<p>Check out the <a href="README">README</a> and <a href="themes">themes</a>.</p>
<p>Or <a href="test">create a new page</a>.</p>
`
assert.Equal(t, b.String(), r)
}