MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestUpdateSet

Function TestUpdateSet

base/set_test.go:83–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestUpdateSet(t *testing.T) {
84 var nilSet Set
85 empty := Set{}
86 set1 := SetOf("foo", "bar", "baz")
87 set2 := SetOf("bar", "block", "deny")
88 assert.Equal(t, set1, set1.Update(empty))
89 assert.Equal(t, set1, empty.Update(set1))
90 assert.Equal(t, set1, set1.Update(nilSet))
91 assert.Equal(t, set1, nilSet.Update(set1))
92 assert.Equal(t, nilSet, nilSet.Update(nilSet))
93 assert.Equal(t, "{bar, baz, block, deny, foo}", set1.Update(set2).String())
94}
95
96func TestSetMarshal(t *testing.T) {
97 var str struct {

Callers

nothing calls this directly

Calls 4

UpdateMethod · 0.95
SetOfFunction · 0.70
StringMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected