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

Function TestEqualExportedValues

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

Source from the content-addressed store, hash-verified

366}
367
368func TestEqualExportedValues(t *testing.T) {
369 cases := []struct {
370 value1 interface{}
371 value2 interface{}
372 expectedEqual bool
373 expectedFail string
374 }{
375 {
376 value1: S{1, Nested{2, 3}, 4, Nested{5, 6}},
377 value2: S{1, Nested{2, nil}, nil, Nested{}},
378 expectedEqual: true,
379 },
380 {
381 value1: S{1, Nested{2, 3}, 4, Nested{5, 6}},
382 value2: S{1, Nested{1, nil}, nil, Nested{}},
383 expectedEqual: false,
384 expectedFail: `
385 Diff:
386 --- Expected
387 +++ Actual
388 @@ -3,3 +3,3 @@
389 Exported2: (assert.Nested) {
390 - Exported: (int) 2,
391 + Exported: (int) 1,
392 notExported: (interface {}) <nil>`,
393 },
394 {
395 value1: S3{&Nested{1, 2}, &Nested{3, 4}},
396 value2: S3{&Nested{"a", 2}, &Nested{3, 4}},
397 expectedEqual: false,
398 expectedFail: `
399 Diff:
400 --- Expected
401 +++ Actual
402 @@ -2,3 +2,3 @@
403 Exported1: (*assert.Nested)({
404 - Exported: (int) 1,
405 + Exported: (string) (len=1) "a",
406 notExported: (interface {}) <nil>`,
407 },
408 {
409 value1: S4{[]*Nested{
410 {1, 2},
411 {3, 4},
412 }},
413 value2: S4{[]*Nested{
414 {1, "a"},
415 {2, "b"},
416 }},
417 expectedEqual: false,
418 expectedFail: `
419 Diff:
420 --- Expected
421 +++ Actual
422 @@ -7,3 +7,3 @@
423 (*assert.Nested)({
424 - Exported: (int) 3,
425 + Exported: (int) 2,

Callers

nothing calls this directly

Calls 5

RunMethod · 0.80
errorStringMethod · 0.80
EqualExportedValuesFunction · 0.70
ErrorfMethod · 0.65
ContainsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…