github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/strings/unescape_test.go (about)

     1  package strings_test
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  
     7  	"github.com/MontFerret/ferret/pkg/runtime/values"
     8  
     9  	"github.com/MontFerret/ferret/pkg/stdlib/strings"
    10  
    11  	. "github.com/smartystreets/goconvey/convey"
    12  )
    13  
    14  func TestUnescapeHTML(t *testing.T) {
    15  	Convey("UnescapeHTML", t, func() {
    16  		Convey("Should unescape an string", func() {
    17  			out, err := strings.UnescapeHTML(context.Background(), values.NewString("<body><span>Foobar</span></body>"))
    18  
    19  			expected := values.NewString("<body><span>Foobar</span></body>")
    20  			So(err, ShouldBeNil)
    21  			So(out, ShouldEqual, expected)
    22  		})
    23  	})
    24  }