1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 17:47:03 +00:00
Files
go-inbucket/web/helpers_test.go
James Hillyerd 7215c041dc Package reorganization part 2
End goal is to simplify build
2012-10-22 15:48:55 -07:00

20 lines
470 B
Go

package web
import (
"github.com/stretchrcom/testify/assert"
"testing"
)
func TestTextToHtml(t *testing.T) {
// Identity
assert.Equal(t, textToHtml("html"), "html")
// Check it escapes
assert.Equal(t, textToHtml("<html>"), "&lt;html&gt;")
// Check for linebreaks
assert.Equal(t, textToHtml("line\nbreak"), "line<br/>\nbreak")
assert.Equal(t, textToHtml("line\r\nbreak"), "line<br/>\nbreak")
assert.Equal(t, textToHtml("line\rbreak"), "line<br/>\nbreak")
}