1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-06-17 00:07:49 +02:00
Files
fp-go/errors/message_test.go

19 lines
312 B
Go
Raw Normal View History

package errors
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestOnError(t *testing.T) {
onError := OnError("Failed to process [%s]", "filename")
err := fmt.Errorf("Cause")
err1 := onError(err)
assert.Equal(t, "Failed to process [filename], Caused By: Cause", err1.Error())
}