MCPcopy
hub / github.com/expr-lang/expr / TestDiff

Function TestDiff

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

Source from the content-addressed store, hash-verified

2256}
2257
2258func TestDiff(t *testing.T) {
2259 expected := `
2260
2261Diff:
2262--- Expected
2263+++ Actual
2264@@ -1,3 +1,3 @@
2265 (struct { foo string }) {
2266- foo: (string) (len=5) "hello"
2267+ foo: (string) (len=3) "bar"
2268 }
2269`
2270 actual := diff(
2271 struct{ foo string }{"hello"},
2272 struct{ foo string }{"bar"},
2273 )
2274 Equal(t, expected, actual)
2275
2276 expected = `
2277
2278Diff:
2279--- Expected
2280+++ Actual
2281@@ -2,5 +2,5 @@
2282 (int) 1,
2283- (int) 2,
2284 (int) 3,
2285- (int) 4
2286+ (int) 5,
2287+ (int) 7
2288 }
2289`
2290 actual = diff(
2291 []int{1, 2, 3, 4},
2292 []int{1, 3, 5, 7},
2293 )
2294 Equal(t, expected, actual)
2295
2296 expected = `
2297
2298Diff:
2299--- Expected
2300+++ Actual
2301@@ -2,4 +2,4 @@
2302 (int) 1,
2303- (int) 2,
2304- (int) 3
2305+ (int) 3,
2306+ (int) 5
2307 }
2308`
2309 actual = diff(
2310 []int{1, 2, 3, 4}[0:3],
2311 []int{1, 3, 5, 7}[0:3],
2312 )
2313 Equal(t, expected, actual)
2314
2315 expected = `

Callers

nothing calls this directly

Calls 2

diffFunction · 0.85
EqualFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…