Skip to content

Commit

Permalink
Restore 100% test coverage (NilPointersAreZero case)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-nichter committed Jun 23, 2024
1 parent 47ae1b8 commit 185886d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions deep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1604,4 +1604,12 @@ func TestNilPointersAreZero(t *testing.T) {
if len(diff) != 1 {
t.Fatalf("expected 1 diff, got %d: %s", len(diff), diff)
}

a.S = new(string)
*a.S = "hi again"
b.S = nil
diff = deep.Equal(a, b)
if len(diff) != 1 {
t.Fatalf("expected 1 diff, got %d: %s", len(diff), diff)
}
}

0 comments on commit 185886d

Please sign in to comment.