|
|
@ -81,12 +81,12 @@ func TestReader(t *testing.T) { |
|
|
|
|
|
|
|
// Active, Start, Duration, Idle, Bytes, Samples, InstRate, CurRate, AvgRate, PeakRate, BytesRem, TimeRem, Progress
|
|
|
|
want := []Status{ |
|
|
|
Status{true, start, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
|
|
|
Status{true, start, _100ms, 0, 10, 1, 100, 100, 100, 100, 0, 0, 0}, |
|
|
|
Status{true, start, _200ms, _100ms, 20, 2, 100, 100, 100, 100, 0, 0, 0}, |
|
|
|
Status{true, start, _300ms, _200ms, 20, 3, 0, 90, 67, 100, 0, 0, 0}, |
|
|
|
Status{false, start, _300ms, 0, 20, 3, 0, 0, 67, 100, 0, 0, 0}, |
|
|
|
Status{false, start, _300ms, 0, 20, 3, 0, 0, 67, 100, 0, 0, 0}, |
|
|
|
{true, start, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
|
|
|
{true, start, _100ms, 0, 10, 1, 100, 100, 100, 100, 0, 0, 0}, |
|
|
|
{true, start, _200ms, _100ms, 20, 2, 100, 100, 100, 100, 0, 0, 0}, |
|
|
|
{true, start, _300ms, _200ms, 20, 3, 0, 90, 67, 100, 0, 0, 0}, |
|
|
|
{false, start, _300ms, 0, 20, 3, 0, 0, 67, 100, 0, 0, 0}, |
|
|
|
{false, start, _300ms, 0, 20, 3, 0, 0, 67, 100, 0, 0, 0}, |
|
|
|
} |
|
|
|
for i, s := range status { |
|
|
|
if !statusesAreEqual(&s, &want[i]) { |
|
|
@ -139,8 +139,8 @@ func TestWriter(t *testing.T) { |
|
|
|
|
|
|
|
// Active, Start, Duration, Idle, Bytes, Samples, InstRate, CurRate, AvgRate, PeakRate, BytesRem, TimeRem, Progress
|
|
|
|
want := []Status{ |
|
|
|
Status{true, start, _400ms, 0, 80, 4, 200, 200, 200, 200, 20, _100ms, 80000}, |
|
|
|
Status{true, start, _500ms, _100ms, 100, 5, 200, 200, 200, 200, 0, 0, 100000}, |
|
|
|
{true, start, _400ms, 0, 80, 4, 200, 200, 200, 200, 20, _100ms, 80000}, |
|
|
|
{true, start, _500ms, _100ms, 100, 5, 200, 200, 200, 200, 0, 0, 100000}, |
|
|
|
} |
|
|
|
for i, s := range status { |
|
|
|
if !statusesAreEqual(&s, &want[i]) { |
|
|
|