package utils
import "testing"
func TestStripHTMLTags(t *testing.T) {
testCases := []struct {
htmlInput string
expect string
}{
{htmlInput: "
Hello World!",
expect: "Hello World!"},
{htmlInput: "Hello World!
",
expect: "Hello World!"},
{htmlInput: "Hello World!
",
expect: "Hello World!"},
{htmlInput: " Hello World! | ", expect: "Hello World!"},
}
for _, tc := range testCases {
got := StripHTMLTags(tc.htmlInput)
expect := tc.expect
if got != expect {
t.Errorf("Expected %s, got %s", expect, got)
}
}
}