| 1 | // Copyright (c) The EfficientGo Authors. |
| 2 | // Licensed under the Apache License 2.0. |
| 3 | |
| 4 | package testutilscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/ |
| 5 | |
| 6 | import ( |
| 7 | "fmtscip-go gomod github.com/golang/go/src go1.17 fmt/" |
| 8 | "path/filepathscip-go gomod github.com/golang/go/src go1.17 `path/filepath`/" |
| 9 | "reflectscip-go gomod github.com/golang/go/src go1.17 reflect/" |
| 10 | "runtimescip-go gomod github.com/golang/go/src go1.17 runtime/" |
| 11 | "runtime/debugscip-go gomod github.com/golang/go/src go1.17 `runtime/debug`/" |
| 12 | "testingscip-go gomod github.com/golang/go/src go1.17 testing/" |
| 13 | |
| 14 | "github.com/davecgh/go-spew/spewscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/" |
| 15 | "github.com/efficientgo/core/errorsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/errors`/" |
| 16 | "github.com/efficientgo/core/testutil/internalscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/" |
| 17 | "github.com/google/go-cmp/cmpscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/" |
| 18 | ) |
| 19 | |
| 20 | const limitOfElemCharsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/limitOfElemChars. = 1e3 |
| 21 | |
| 22 | func withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(f string, v ...interface{}) string { |
| 23 | s := fmtscip-go gomod github.com/golang/go/src go1.17 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.17 fmt/Sprintf().(f, v...) |
| 24 | if len(s) > limitOfElemCharsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/limitOfElemChars. { |
| 25 | return s[:limitOfElemCharsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/limitOfElemChars.] + "...(output trimmed)" |
| 26 | } |
| 27 | return s |
| 28 | } |
| 29 | |
| 30 | // Assert fails the test if the condition is false. |
| 31 | func Assertscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/Assert().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, condition bool, v ...interface{}) { |
| 32 | tb.Helperscip-go gomod github.com/golang/go/src go1.17 testing/TB#Helper().() |
| 33 | if condition { |
| 34 | return |
| 35 | } |
| 36 | _, file, line, _ := runtimescip-go gomod github.com/golang/go/src go1.17 runtime/.Callerscip-go gomod github.com/golang/go/src go1.17 runtime/Caller().(1) |
| 37 | |
| 38 | var msg string |
| 39 | if len(v) > 0 { |
| 40 | msg = fmtscip-go gomod github.com/golang/go/src go1.17 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.17 fmt/Sprintf().(v[0].(string), v[1:]...) |
| 41 | } |
| 42 | tb.Fatalfscip-go gomod github.com/golang/go/src go1.17 testing/TB#Fatalf().("\033[31m%s:%d: \"%s\"\033[39m\n\n", filepathscip-go gomod github.com/golang/go/src go1.17 `path/filepath`/.Basescip-go gomod github.com/golang/go/src go1.17 `path/filepath`/Base().(file), line, withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(msg)) |
| 43 | } |
| 44 | |
| 45 | // Ok fails the test if an err is not nil. |
| 46 | func Okscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/Ok().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, err error, v ...interface{}) { |
| 47 | tb.Helperscip-go gomod github.com/golang/go/src go1.17 testing/TB#Helper().() |
| 48 | if err == nil { |
| 49 | return |
| 50 | } |
| 51 | _, file, line, _ := runtimescip-go gomod github.com/golang/go/src go1.17 runtime/.Callerscip-go gomod github.com/golang/go/src go1.17 runtime/Caller().(1) |
| 52 | |
| 53 | var msg string |
| 54 | if len(v) > 0 { |
| 55 | msg = fmtscip-go gomod github.com/golang/go/src go1.17 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.17 fmt/Sprintf().(v[0].(string), v[1:]...) |
| 56 | } |
| 57 | tb.Fatalfscip-go gomod github.com/golang/go/src go1.17 testing/TB#Fatalf().("\033[31m%s:%d: \"%s\"\n\n unexpected error: %s\033[39m\n\n", filepathscip-go gomod github.com/golang/go/src go1.17 `path/filepath`/.Basescip-go gomod github.com/golang/go/src go1.17 `path/filepath`/Base().(file), line, withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(msg), withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(err.Error())) |
| 58 | } |
| 59 | |
| 60 | // NotOk fails the test if an err is nil. |
| 61 | func NotOkscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/NotOk().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, err error, v ...interface{}) { |
| 62 | tb.Helperscip-go gomod github.com/golang/go/src go1.17 testing/TB#Helper().() |
| 63 | if err != nil { |
| 64 | return |
| 65 | } |
| 66 | _, file, line, _ := runtimescip-go gomod github.com/golang/go/src go1.17 runtime/.Callerscip-go gomod github.com/golang/go/src go1.17 runtime/Caller().(1) |
| 67 | |
| 68 | var msg string |
| 69 | if len(v) > 0 { |
| 70 | msg = fmtscip-go gomod github.com/golang/go/src go1.17 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.17 fmt/Sprintf().(v[0].(string), v[1:]...) |
| 71 | } |
| 72 | tb.Fatalfscip-go gomod github.com/golang/go/src go1.17 testing/TB#Fatalf().("\033[31m%s:%d: \"%s\"\n\n expected error, got nothing \033[39m\n\n", filepathscip-go gomod github.com/golang/go/src go1.17 `path/filepath`/.Basescip-go gomod github.com/golang/go/src go1.17 `path/filepath`/Base().(file), line, withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(msg)) |
| 73 | } |
| 74 | |
| 75 | // Equals fails the test if exp is not equal to act. |
| 76 | func Equalsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/Equals().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, exp, act interface{}, v ...interface{}) { |
| 77 | tb.Helperscip-go gomod github.com/golang/go/src go1.17 testing/TB#Helper().() |
| 78 | if reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.DeepEqualscip-go gomod github.com/golang/go/src go1.17 reflect/DeepEqual().(exp, act) { |
| 79 | return |
| 80 | } |
| 81 | fatalNotEqualscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/fatalNotEqual().(tb, exp, act, v...) |
| 82 | } |
| 83 | |
| 84 | func fatalNotEqualscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/fatalNotEqual().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, exp, act interface{}, v ...interface{}) { |
| 85 | _, file, line, _ := runtimescip-go gomod github.com/golang/go/src go1.17 runtime/.Callerscip-go gomod github.com/golang/go/src go1.17 runtime/Caller().(2) |
| 86 | |
| 87 | var msg string |
| 88 | if len(v) > 0 { |
| 89 | msg = fmtscip-go gomod github.com/golang/go/src go1.17 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.17 fmt/Sprintf().(v[0].(string), v[1:]...) |
| 90 | } |
| 91 | tb.Fatalfscip-go gomod github.com/golang/go/src go1.17 testing/TB#Fatalf().( |
| 92 | "\033[31m%s:%d: \"%s\"\n\n\texp: %s\n\n\tgot: %s%s\033[39m\n\n", |
| 93 | filepathscip-go gomod github.com/golang/go/src go1.17 `path/filepath`/.Basescip-go gomod github.com/golang/go/src go1.17 `path/filepath`/Base().(file), line, withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(msg), withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().("%#v", exp), withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().("%#v", act), withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().(diffscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/diff().(exp, act)), |
| 94 | ) |
| 95 | } |
| 96 | |
| 97 | type goCmpscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp# struct { |
| 98 | optsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp#opts. cmpscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/.Optionsscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/Options# |
| 99 | } |
| 100 | |
| 101 | // WithGoCmp allows specifying options and using https://github.com/google/go-cmp |
| 102 | // for equality comparisons. The compatibility guarantee of this function's arguments |
| 103 | // are the same as go-cmp (no guarantee due to v0.x). |
| 104 | func WithGoCmpscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/WithGoCmp().(opts ...cmpscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/.Optionscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/Option#) goCmpscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp# { |
| 105 | return goCmpscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp#{optsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp#opts.: opts} |
| 106 | } |
| 107 | |
| 108 | // Equals uses go-cmp for comparing equality between two structs, and can be used with |
| 109 | // various options defined in go-cmp/cmp and go-cmp/cmp/cmpopts. |
| 110 | func (o goCmpscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp#) Equalsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp#Equals().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, exp, act interface{}, v ...interface{}) { |
| 111 | tb.Helperscip-go gomod github.com/golang/go/src go1.17 testing/TB#Helper().() |
| 112 | if cmpscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/.Equalscip-go gomod github.com/google/go-cmp v0.5.9 `github.com/google/go-cmp/cmp`/Equal().(exp, act, o.optsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/goCmp#opts.) { |
| 113 | return |
| 114 | } |
| 115 | fatalNotEqualscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/fatalNotEqual().(tb, exp, act, v...) |
| 116 | } |
| 117 | |
| 118 | // FaultOrPanicToErr returns error if panic of fault was triggered during execution of function. |
| 119 | func FaultOrPanicToErrscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/FaultOrPanicToErr().(f func()) (err error) { |
| 120 | // Set this go routine to panic on segfault to allow asserting on those. |
| 121 | debugscip-go gomod github.com/golang/go/src go1.17 `runtime/debug`/.SetPanicOnFaultscip-go gomod github.com/golang/go/src go1.17 `runtime/debug`/SetPanicOnFault().(true) |
| 122 | defer func() { |
| 123 | if r := recover(); r != nil { |
| 124 | err = errorsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/errors`/.Newfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/errors`/Newf().("invoked function panicked or caused segmentation fault: %v", r) |
| 125 | } |
| 126 | debugscip-go gomod github.com/golang/go/src go1.17 `runtime/debug`/.SetPanicOnFaultscip-go gomod github.com/golang/go/src go1.17 `runtime/debug`/SetPanicOnFault().(false) |
| 127 | }() |
| 128 | |
| 129 | f() |
| 130 | |
| 131 | return err |
| 132 | } |
| 133 | |
| 134 | // ContainsStringSlice fails the test if needle is not contained within haystack, if haystack or needle is |
| 135 | // an empty slice, or if needle is longer than haystack. |
| 136 | func ContainsStringSlicescip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/ContainsStringSlice().(tb testingscip-go gomod github.com/golang/go/src go1.17 testing/.TBscip-go gomod github.com/golang/go/src go1.17 testing/TB#, haystack, needle []string) { |
| 137 | _, file, line, _ := runtimescip-go gomod github.com/golang/go/src go1.17 runtime/.Callerscip-go gomod github.com/golang/go/src go1.17 runtime/Caller().(1) |
| 138 | |
| 139 | if !containsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/contains().(haystack, needle) { |
| 140 | tb.Fatalfscip-go gomod github.com/golang/go/src go1.17 testing/TB#Fatalf().("\033[31m%s:%d: %s does not contain %s\033[39m\n\n", filepathscip-go gomod github.com/golang/go/src go1.17 `path/filepath`/.Basescip-go gomod github.com/golang/go/src go1.17 `path/filepath`/Base().(file), line, withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().("%#v", haystack), withLimitfscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/withLimitf().("%#v", needle)) |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | func containsscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/contains().(haystack, needle []string) bool { |
| 145 | if len(haystack) == 0 || len(needle) == 0 { |
| 146 | return false |
| 147 | } |
| 148 | |
| 149 | if len(haystack) < len(needle) { |
| 150 | return false |
| 151 | } |
| 152 | |
| 153 | for i := 0; i < len(haystack); i++ { |
| 154 | outer := i |
| 155 | |
| 156 | for j := 0; j < len(needle); j++ { |
| 157 | // End of the haystack but not the end of the needle, end |
| 158 | if outer == len(haystack) { |
| 159 | return false |
| 160 | } |
| 161 | |
| 162 | // No match, try the next index of the haystack |
| 163 | if haystack[outer] != needle[j] { |
| 164 | break |
| 165 | } |
| 166 | |
| 167 | // End of the needle and it still matches, end |
| 168 | if j == len(needle)-1 { |
| 169 | return true |
| 170 | } |
| 171 | |
| 172 | // This element matches between the two slices, try the next one |
| 173 | outer++ |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | return false |
| 178 | } |
| 179 | |
| 180 | func typeAndKindscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/typeAndKind().(v interface{}) (reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Typescip-go gomod github.com/golang/go/src go1.17 reflect/Type#, reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Kindscip-go gomod github.com/golang/go/src go1.17 reflect/Kind#) { |
| 181 | t := reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.17 reflect/TypeOf().(v) |
| 182 | k := t.Kindscip-go gomod github.com/golang/go/src go1.17 reflect/Type#Kind().() |
| 183 | |
| 184 | if k == reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Ptrscip-go gomod github.com/golang/go/src go1.17 reflect/Ptr. { |
| 185 | t = t.Elemscip-go gomod github.com/golang/go/src go1.17 reflect/Type#Elem().() |
| 186 | k = t.Kindscip-go gomod github.com/golang/go/src go1.17 reflect/Type#Kind().() |
| 187 | } |
| 188 | return t, k |
| 189 | } |
| 190 | |
| 191 | // diff returns a diff of both values as long as both are of the same type and |
| 192 | // are a struct, map, slice, array or string. Otherwise it returns an empty string. |
| 193 | func diffscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/diff().(expected interface{}, actual interface{}) string { |
| 194 | if expected == nil || actual == nil { |
| 195 | return "" |
| 196 | } |
| 197 | |
| 198 | et, ek := typeAndKindscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/typeAndKind().(expected) |
| 199 | at, _ := typeAndKindscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil`/typeAndKind().(actual) |
| 200 | if et != at { |
| 201 | return "" |
| 202 | } |
| 203 | |
| 204 | if ek != reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Structscip-go gomod github.com/golang/go/src go1.17 reflect/Struct. && ek != reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Mapscip-go gomod github.com/golang/go/src go1.17 reflect/Map. && ek != reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Slicescip-go gomod github.com/golang/go/src go1.17 reflect/Slice. && ek != reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Arrayscip-go gomod github.com/golang/go/src go1.17 reflect/Array. && ek != reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.Stringscip-go gomod github.com/golang/go/src go1.17 reflect/String. { |
| 205 | return "" |
| 206 | } |
| 207 | |
| 208 | var e, a string |
| 209 | c := spewscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/.ConfigStatescip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#{ |
| 210 | Indentscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Indent.: " ", |
| 211 | DisablePointerAddressesscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisablePointerAddresses.: true, |
| 212 | DisableCapacitiesscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#DisableCapacities.: true, |
| 213 | SortKeysscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#SortKeys.: true, |
| 214 | } |
| 215 | if et != reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.TypeOfscip-go gomod github.com/golang/go/src go1.17 reflect/TypeOf().("") { |
| 216 | e = c.Sdumpscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Sdump().(expected) |
| 217 | a = c.Sdumpscip-go gomod github.com/davecgh/go-spew v1.1.1 `github.com/davecgh/go-spew/spew`/ConfigState#Sdump().(actual) |
| 218 | } else { |
| 219 | e = reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.17 reflect/ValueOf().(expected).Stringscip-go gomod github.com/golang/go/src go1.17 reflect/Value#String().() |
| 220 | a = reflectscip-go gomod github.com/golang/go/src go1.17 reflect/.ValueOfscip-go gomod github.com/golang/go/src go1.17 reflect/ValueOf().(actual).Stringscip-go gomod github.com/golang/go/src go1.17 reflect/Value#String().() |
| 221 | } |
| 222 | |
| 223 | diff, _ := internalscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/.GetUnifiedDiffStringscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/GetUnifiedDiffString().(internalscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/.UnifiedDiffscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#{ |
| 224 | Ascip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#A.: internalscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/.SplitLinesscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/SplitLines().(e), |
| 225 | Bscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#B.: internalscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/.SplitLinesscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/SplitLines().(a), |
| 226 | FromFilescip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#FromFile.: "Expected", |
| 227 | FromDatescip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#FromDate.: "", |
| 228 | ToFilescip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#ToFile.: "Actual", |
| 229 | ToDatescip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#ToDate.: "", |
| 230 | Contextscip-go gomod github.com/efficientgo/core . `github.com/efficientgo/core/testutil/internal`/UnifiedDiff#Context.: 1, |
| 231 | }) |
| 232 | return "\n\nDiff:\n" + diff |
| 233 | } |