Add unit test for tarSum.Sum() with no data
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
parent
6a74f071af
commit
e257863a9a
|
@ -230,6 +230,17 @@ func TestEmptyTar(t *testing.T) {
|
||||||
if resultSum != expectedSum {
|
if resultSum != expectedSum {
|
||||||
t.Fatalf("expected [%s] but got [%s]", expectedSum, resultSum)
|
t.Fatalf("expected [%s] but got [%s]", expectedSum, resultSum)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test without ever actually writing anything.
|
||||||
|
if ts, err = NewTarSum(bytes.NewReader([]byte{}), true, Version0); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
resultSum = ts.Sum(nil)
|
||||||
|
|
||||||
|
if resultSum != expectedSum {
|
||||||
|
t.Fatalf("expected [%s] but got [%s]", expectedSum, resultSum)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Reference in New Issue