// Copyright 2017 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package markup_test
import (
"testing"
"github.com/stretchr/testify/assert"
. "gogs.io/gogs/internal/markup"
)
func Test_Sanitizer(t *testing.T) {
NewSanitizer()
tests := []struct {
input string
expVal string
}{
// Regular
{input: `Google`, expVal: `Google`},
// Code highlighting class
{input: `
`, expVal: `
`},
{input: `
`, expVal: `
`},
{input: `
`, expVal: `
`},
// Input checkbox
{input: ``, expVal: ``},
{input: ``, expVal: ``},
{input: ``, expVal: ``},
}
for _, test := range tests {
t.Run(test.input, func(t *testing.T) {
assert.Equal(t, test.expVal, Sanitize(test.input))
assert.Equal(t, test.expVal, string(SanitizeBytes([]byte(test.input))))
})
}
}