MCPcopy Index your code
hub / github.com/expr-lang/expr / TestNotErrorIs

Function TestNotErrorIs

internal/testify/assert/assertions_test.go:3069–3133  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3067}
3068
3069func TestNotErrorIs(t *testing.T) {
3070 tests := []struct {
3071 err error
3072 target error
3073 result bool
3074 resultErrMsg string
3075 }{
3076 {
3077 err: io.EOF,
3078 target: io.EOF,
3079 result: false,
3080 resultErrMsg: "" +
3081 "Target error should not be in err chain:\n" +
3082 "found: \"EOF\"\n" +
3083 "in chain: \"EOF\"\n",
3084 },
3085 {
3086 err: fmt.Errorf("wrap: %w", io.EOF),
3087 target: io.EOF,
3088 result: false,
3089 resultErrMsg: "" +
3090 "Target error should not be in err chain:\n" +
3091 "found: \"EOF\"\n" +
3092 "in chain: \"wrap: EOF\"\n" +
3093 "\t\"EOF\"\n",
3094 },
3095 {
3096 err: io.EOF,
3097 target: io.ErrClosedPipe,
3098 result: true,
3099 },
3100 {
3101 err: nil,
3102 target: io.EOF,
3103 result: true,
3104 },
3105 {
3106 err: io.EOF,
3107 target: nil,
3108 result: true,
3109 },
3110 {
3111 err: nil,
3112 target: nil,
3113 result: false,
3114 resultErrMsg: "" +
3115 "Target error should not be in err chain:\n" +
3116 "found: \"\"\n" +
3117 "in chain: \n",
3118 },
3119 {
3120 err: fmt.Errorf("abc: %w", errors.New("def")),
3121 target: io.EOF,
3122 result: true,
3123 },
3124 }
3125 for _, tt := range tests {
3126 tt := tt

Callers

nothing calls this directly

Calls 5

RunMethod · 0.80
SprintfMethod · 0.80
checkResultAndErrMsgMethod · 0.80
NotErrorIsFunction · 0.70
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…