mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Fix pkg/streamformatter.TestJSONFormatProgress
The test was failing if the terminal column width is <= 110. Addendum to #23113 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
		
							parent
							
								
									ba372df79c
								
							
						
					
					
						commit
						da7edb5f3c
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -94,8 +94,12 @@ func TestJSONFormatProgress(t *testing.T) {
 | 
			
		|||
 | 
			
		||||
	// Compare the progress strings before the timeLeftBox
 | 
			
		||||
	expectedProgress := "[=========================>                         ]     15 B/30 B"
 | 
			
		||||
	if !strings.HasPrefix(msg.ProgressMessage, expectedProgress) {
 | 
			
		||||
		t.Fatalf("ProgressMessage without the timeLeftBox must be %s, got: %s", expectedProgress, msg.ProgressMessage)
 | 
			
		||||
	// if terminal column is <= 110, expectedProgressShort is expected.
 | 
			
		||||
	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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue