package errorpageclassifier import ( "testing" "github.com/stretchr/testify/assert" ) func TestErrorPageClassifier(t *testing.T) { t.Run("test creation of new ErrorPageClassifier", func(t *testing.T) { epc := New() assert.NotNil(t, epc) }) t.Run("test classification non error page text", func(t *testing.T) { epc := New() assert.Equal(t, "nonerror", epc.Classify(` Terms of Service

Welcome to our Terms of Service page.

Understand our conditions for providing services.

`)) }) t.Run("test classification on error page text", func(t *testing.T) { epc := New() assert.Equal(t, "error", epc.Classify(` Error 403: Forbidden

Error 403: Forbidden

Sorry you don't have access rights to this page.

`)) }) }