Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
saiskee committed Apr 19, 2024
1 parent 5b9a01d commit 03b8b9e
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions contrib/tests/set_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,22 @@ var _ = Describe("PaintSetV2", func() {

setB = setA.ShallowCopy()
Expect(setB.Has(newPaint)).To(BeTrue())
np := setA.Get(newPaint)
np.Name = "newPaintWithNewName"
Expect(setB.Len()).To(Equal(4))
npShouldBeExactSame := setB.Get(newPaint)
Expect(npShouldBeExactSame.Name).To(Equal("newPaintWithNewName"))
Expect(npShouldBeExactSame == np).To(BeTrue())
// so sorry for this n^2 comparison,
// want to make sure that the pointers are the same in both sets but have no better way to do it
setB.Iter(func(i int, p *v1.Paint) bool {
setA.Iter(func(j int, p2 *v1.Paint) bool {
if i == j {
Expect(p == p2).To(BeTrue())
}
return true
})
})

Check failure on line 132 in contrib/tests/set_v2_test.go

View workflow job for this annotation

GitHub Actions / Tests

missing return
// np := setA.Get(newPaint)
// np.Name = "newPaintWithNewName"
// Expect(setB.Len()).To(Equal(4))
// npShouldBeExactSame := setB.Get(newPaint)
// Expect(npShouldBeExactSame.Name).To(Equal("newPaintWithNewName"))
// Expect(npShouldBeExactSame == np).To(BeTrue())
})

It("should double filter List", func() {
Expand Down

0 comments on commit 03b8b9e

Please sign in to comment.