diff options
Diffstat (limited to 'formats/objfile')
-rw-r--r-- | formats/objfile/reader_test.go | 6 | ||||
-rw-r--r-- | formats/objfile/writer_test.go | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/formats/objfile/reader_test.go b/formats/objfile/reader_test.go index caebb60..b2c3d0c 100644 --- a/formats/objfile/reader_test.go +++ b/formats/objfile/reader_test.go @@ -19,16 +19,16 @@ var _ = Suite(&SuiteReader{}) func (s *SuiteReader) TestReadObjfile(c *C) { for k, fixture := range objfileFixtures { - comment := fmt.Sprintf("test %d: ", k) + com := fmt.Sprintf("test %d: ", k) hash := core.NewHash(fixture.hash) content, _ := base64.StdEncoding.DecodeString(fixture.content) data, _ := base64.StdEncoding.DecodeString(fixture.data) - testReader(c, bytes.NewReader(data), hash, fixture.t, content, comment) + testReader(c, bytes.NewReader(data), hash, fixture.t, content, com) } } -func testReader(c *C, source io.Reader, hash core.Hash, typ core.ObjectType, content []byte, comment string) { +func testReader(c *C, source io.Reader, hash core.Hash, typ core.ObjectType, content []byte, com string) { r, err := NewReader(source) c.Assert(err, IsNil) c.Assert(r.Type(), Equals, typ) diff --git a/formats/objfile/writer_test.go b/formats/objfile/writer_test.go index 0061f3f..160491c 100644 --- a/formats/objfile/writer_test.go +++ b/formats/objfile/writer_test.go @@ -16,20 +16,20 @@ var _ = Suite(&SuiteWriter{}) func (s *SuiteWriter) TestWriteObjfile(c *C) { for k, fixture := range objfileFixtures { - comment := fmt.Sprintf("test %d: ", k) + com := fmt.Sprintf("test %d: ", k) hash := core.NewHash(fixture.hash) content, _ := base64.StdEncoding.DecodeString(fixture.content) buffer := new(bytes.Buffer) // Write the data out to the buffer - testWriter(c, buffer, hash, fixture.t, content, comment) + testWriter(c, buffer, hash, fixture.t, content, com) // Read the data back in from the buffer to be sure it matches - testReader(c, buffer, hash, fixture.t, content, comment) + testReader(c, buffer, hash, fixture.t, content, com) } } -func testWriter(c *C, dest io.Writer, hash core.Hash, typ core.ObjectType, content []byte, comment string) { +func testWriter(c *C, dest io.Writer, hash core.Hash, typ core.ObjectType, content []byte, com string) { length := int64(len(content)) w, err := NewWriter(dest, typ, length) c.Assert(err, IsNil) |