(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func 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 | |
| 94 | var clearTests = []struct { |
| 95 | Initial []string |
nothing calls this directly
no test coverage detected