mirror of
https://github.com/MontFerret/ferret.git
synced 2025-02-07 13:31:56 +02:00
23 lines
574 B
Go
23 lines
574 B
Go
package strings_test
|
|
|
|
import (
|
|
"context"
|
|
"github.com/MontFerret/ferret/pkg/runtime/values"
|
|
"testing"
|
|
|
|
"github.com/MontFerret/ferret/pkg/stdlib/strings"
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
)
|
|
|
|
func TestEscapeHTML(t *testing.T) {
|
|
Convey("EscapeHTML", t, func() {
|
|
Convey("Should escape an HTML string", func() {
|
|
out, err := strings.EscapeHTML(context.Background(), values.NewString(`<body><span>Foobar</span></body>`))
|
|
|
|
So(err, ShouldBeNil)
|
|
So(out, ShouldEqual, values.NewString("<body><span>Foobar</span></body>"))
|
|
})
|
|
})
|
|
}
|