File: csvutil_go113_test.go

package info (click to toggle)
golang-github-jszwec-csvutil 1.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 396 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// +build go1.13

package csvutil

import (
	"errors"
	"fmt"
	"reflect"
	"testing"
)

func TestMarshalerError(t *testing.T) {
	testErr := errors.New("error")

	err := fmt.Errorf("some custom error: %w", &MarshalerError{
		Type:          reflect.TypeOf(1),
		MarshalerType: "csvutil.Marshaler",
		Err:           testErr,
	})

	if !errors.Is(err, testErr) {
		t.Errorf("expected errors.Is to return testErr")
	}
}