1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #23120 from AkihiroSuda/fixStreamFormatter

Fix pkg/streamformatter.TestJSONFormatProgress
This commit is contained in:
Alexander Morozov 2016-06-01 14:37:35 -07:00
commit 2ca25302fe

View file

@ -94,8 +94,12 @@ func TestJSONFormatProgress(t *testing.T) {
// Compare the progress strings before the timeLeftBox // Compare the progress strings before the timeLeftBox
expectedProgress := "[=========================> ] 15 B/30 B" expectedProgress := "[=========================> ] 15 B/30 B"
if !strings.HasPrefix(msg.ProgressMessage, expectedProgress) { // if terminal column is <= 110, expectedProgressShort is expected.
t.Fatalf("ProgressMessage without the timeLeftBox must be %s, got: %s", expectedProgress, msg.ProgressMessage) expectedProgressShort := " 15 B/30 B"
if !(strings.HasPrefix(msg.ProgressMessage, expectedProgress) ||
strings.HasPrefix(msg.ProgressMessage, expectedProgressShort)) {
t.Fatalf("ProgressMessage without the timeLeftBox must be %s or %s, got: %s",
expectedProgress, expectedProgressShort, msg.ProgressMessage)
} }
if !reflect.DeepEqual(msg.Progress, progress) { if !reflect.DeepEqual(msg.Progress, progress) {