mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +02:00
helpers: Remove ToReader funcs
Remove StringToReader and BytesToReader in favor of using the stdlib directly.
This commit is contained in:
@@ -15,11 +15,12 @@ package transform
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -148,7 +149,7 @@ func TestChaingMultipleTransformers(t *testing.T) {
|
||||
tr := NewChain(f1, f2, f3, f4)
|
||||
|
||||
out := new(bytes.Buffer)
|
||||
if err := tr.Apply(out, helpers.StringToReader("Test: f4 f3 f1 f2 f1 The End."), []byte("")); err != nil {
|
||||
if err := tr.Apply(out, strings.NewReader("Test: f4 f3 f1 f2 f1 The End."), []byte("")); err != nil {
|
||||
t.Errorf("Multi transformer chain returned an error: %s", err)
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ package transform
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/spf13/hugo/helpers"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ func TestLiveReloadInject(t *testing.T) {
|
||||
|
||||
func doTestLiveReloadInject(t *testing.T, bodyEndTag string) {
|
||||
out := new(bytes.Buffer)
|
||||
in := helpers.StringToReader(bodyEndTag)
|
||||
in := strings.NewReader(bodyEndTag)
|
||||
|
||||
tr := NewChain(LiveReloadInject)
|
||||
tr.Apply(out, in, []byte("path"))
|
||||
|
Reference in New Issue
Block a user