Files
Jay Brown 35d72fccbe Merged in feature/remove-mocks (pull request #202)
Feature/remove mocks

* remove mocks

* cleanup db migrations
2026-01-15 20:39:32 +00:00

25 lines
744 B
Go

// Package test provides test utilities.
// Note: Textract-related helpers have been removed since text extraction is deprecated.
// See remove_texttract_and_mocks_plan.md for details.
package test
import (
"io"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// AssertStringToReader compares an expected string with the content from a reader.
func AssertStringToReader(t testing.TB, expected string, actual io.Reader) {
actualBytes, err := io.ReadAll(actual)
require.NoError(t, err)
actualStr := string(actualBytes)
if !assert.Equal(t, expected, actualStr) {
diff := cmp.Diff(expected, actualStr)
t.Logf("Detailed diff (-expected +actual):\n%s", diff)
}
}