MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / TestObjectsRemove

Function TestObjectsRemove

session/objects_test.go:66–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

64}
65
66func TestObjectsRemove(t *testing.T) {
67
68 for _, test := range removeTests {
69
70 var objects Objects
71 objects.ids = test.Initial
72
73 var failed bool
74 var returns []bool
75 for idx, item := range test.Items {
76 returns = append(returns, objects.Remove(item))
77 if returns[idx] != test.Return[idx] {
78 failed = true
79 }
80 }
81
82 failed = failed || !stringSliceEq(objects.ids, test.Expected)
83
84 if failed {
85 t.Errorf(test.Description,
86 test.Items, // input
87 returns, objects.ids, //actual output
88 test.Return, test.Expected, // expected output
89 )
90 }
91 }
92}
93
94var clearTests = []struct {
95 Initial []string

Callers

nothing calls this directly

Calls 2

RemoveMethod · 0.95
stringSliceEqFunction · 0.85

Tested by

no test coverage detected