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

Function TestObjectsAdd

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

Source from the content-addressed store, hash-verified

19}
20
21func TestObjectsAdd(t *testing.T) {
22
23 for _, test := range addTests {
24 var failed bool
25 var objects Objects
26 var returns []bool
27 for idx, item := range test.Items {
28 returns = append(returns, objects.Add(item))
29 if returns[idx] != test.Return[idx] {
30 failed = true
31 }
32 }
33
34 failed = failed || !stringSliceEq(objects.ids, test.Expected)
35
36 if failed {
37 t.Errorf(test.Description,
38 test.Items, // input
39 returns, objects.ids, //actual output
40 test.Return, test.Expected, // expected output
41 )
42 }
43 }
44}
45
46var removeTests = []struct {
47 Initial []string

Callers

nothing calls this directly

Calls 2

AddMethod · 0.95
stringSliceEqFunction · 0.85

Tested by

no test coverage detected