1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 18:17:03 +00:00

Follow meta-linter recommendations for all of Inbucket

- Rename BUILD_DATE to BUILDDATE in goxc
- Update travis config
- Follow linter recommendations for inbucket.go
- Follow linter recommendations for config package
- Follow linter recommendations for log package
- Follow linter recommendations for pop3d package
- Follow linter recommendations for smtpd package
- Follow linter recommendations for web package
- Fix Id -> ID in templates
- Add shebang to REST demo scripts
- Add or refine many comments
This commit is contained in:
James Hillyerd
2016-02-20 23:20:22 -08:00
parent 83f9c6aa49
commit e6b7e335cb
34 changed files with 607 additions and 411 deletions

View File

@@ -9,22 +9,22 @@ import (
func TestTextToHtml(t *testing.T) {
// Identity
assert.Equal(t, textToHtml("html"), template.HTML("html"))
assert.Equal(t, textToHTML("html"), template.HTML("html"))
// Check it escapes
assert.Equal(t, textToHtml("<html>"), template.HTML("&lt;html&gt;"))
assert.Equal(t, textToHTML("<html>"), template.HTML("&lt;html&gt;"))
// Check for linebreaks
assert.Equal(t, textToHtml("line\nbreak"), template.HTML("line<br/>\nbreak"))
assert.Equal(t, textToHtml("line\r\nbreak"), template.HTML("line<br/>\nbreak"))
assert.Equal(t, textToHtml("line\rbreak"), template.HTML("line<br/>\nbreak"))
assert.Equal(t, textToHTML("line\nbreak"), template.HTML("line<br/>\nbreak"))
assert.Equal(t, textToHTML("line\r\nbreak"), template.HTML("line<br/>\nbreak"))
assert.Equal(t, textToHTML("line\rbreak"), template.HTML("line<br/>\nbreak"))
}
func TestURLDetection(t *testing.T) {
assert.Equal(t,
textToHtml("http://google.com/"),
textToHTML("http://google.com/"),
template.HTML("<a href=\"http://google.com/\" target=\"_blank\">http://google.com/</a>"))
assert.Equal(t,
textToHtml("http://a.com/?q=a&n=v"),
textToHTML("http://a.com/?q=a&n=v"),
template.HTML("<a href=\"http://a.com/?q=a&n=v\" target=\"_blank\">http://a.com/?q=a&amp;n=v</a>"))
}