go-test / deep

Golang deep variable equality test that returns human-readable differences
MIT License
751 stars 54 forks source link

Fixes slices equality, when slices are extracted from the same array #11

Closed risteli closed 5 years ago

risteli commented 6 years ago

When creating tests on sliced values, since the slice equality is based only on pointers it will fail whenever both slices are from the same vector, thus sharing the same pointer, but of different lengths. This adds a test for the specific condition, and fixes the equality scenario.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 1c3abb11868c1bd4b3ae2d2b92db6ab11fa97933 on risteli:sibling_slices into 5b97bda3f057768a536296ecbc1d653198075b15 on go-test:master.

daniel-nichter commented 6 years ago

Thanks for bug and PR. Sorry it's taken so long to review this. I posted a comment about one of the tests.

tariq1890 commented 5 years ago

@daniel-nichter Can this be revisited? I would love to have this in the library. I can take over this PR as well.

daniel-nichter commented 5 years ago

Finally merged. :-) Better late than never.