mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Package reorganization part 2
End goal is to simplify build
This commit is contained in:
19
web/helpers_test.go
Normal file
19
web/helpers_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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>"), "<html>")
|
||||
|
||||
// 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")
|
||||
}
|
||||
Reference in New Issue
Block a user