Browse Source

Add field names to table-driven test fixtures

pull/1923/head
Dan Milstein 8 years ago
parent
commit
ec064c96f6
  1. 19
      storage/local/delta_test.go

19
storage/local/delta_test.go

@ -58,23 +58,20 @@ func TestUnmarshalingCorruptedDeltaReturnsAnError(t *testing.T) {
chunkLenPos int chunkLenPos int
}{ }{
{ {
"deltaEncodedChunk", chunkTypeName: "deltaEncodedChunk",
// Hrm. Compiler didn't like a function which returned chunkConstructor: func(a, b deltaBytes, c bool, d int) chunk {
// *deltaEncodedChunk for the chunkConstructor field. This is ugly,
// but I dunno how to make the compiler happy here.
func(a, b deltaBytes, c bool, d int) chunk {
return newDeltaEncodedChunk(a, b, c, d) return newDeltaEncodedChunk(a, b, c, d)
}, },
deltaHeaderBytes, minHeaderLen: deltaHeaderBytes,
deltaHeaderBufLenOffset, chunkLenPos: deltaHeaderBufLenOffset,
}, },
{ {
"doubleDeltaEncodedChunk", chunkTypeName: "doubleDeltaEncodedChunk",
func(a, b deltaBytes, c bool, d int) chunk { chunkConstructor: func(a, b deltaBytes, c bool, d int) chunk {
return newDoubleDeltaEncodedChunk(a, b, c, d) return newDoubleDeltaEncodedChunk(a, b, c, d)
}, },
doubleDeltaHeaderMinBytes, minHeaderLen: doubleDeltaHeaderMinBytes,
doubleDeltaHeaderBufLenOffset, chunkLenPos: doubleDeltaHeaderBufLenOffset,
}, },
} }
for _, c := range cases { for _, c := range cases {

Loading…
Cancel
Save