(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestBitArrayProtoBuf(t *testing.T) { |
| 270 | testCases := []struct { |
| 271 | msg string |
| 272 | bA1 *BitArray |
| 273 | expPass bool |
| 274 | }{ |
| 275 | {"success empty", &BitArray{}, true}, |
| 276 | {"success", NewBitArray(1), true}, |
| 277 | {"success", NewBitArray(2), true}, |
| 278 | {"negative", NewBitArray(-1), false}, |
| 279 | } |
| 280 | for _, tc := range testCases { |
| 281 | protoBA := tc.bA1.ToProto() |
| 282 | ba := new(BitArray) |
| 283 | ba.FromProto(protoBA) |
| 284 | if tc.expPass { |
| 285 | require.Equal(t, tc.bA1, ba, tc.msg) |
| 286 | } else { |
| 287 | require.NotEqual(t, tc.bA1, ba, tc.msg) |
| 288 | } |
| 289 | } |
| 290 | } |
nothing calls this directly
no test coverage detected