You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							21 lines
						
					
					
						
							307 B
						
					
					
				
			
		
		
		
			
			
			
		
		
	
	
							21 lines
						
					
					
						
							307 B
						
					
					
				
								package util
							 | 
						|
								
							 | 
						|
								import (
							 | 
						|
									"testing"
							 | 
						|
								
							 | 
						|
									"golang.org/x/tools/godoc/util"
							 | 
						|
								)
							 | 
						|
								
							 | 
						|
								func TestIsGzippable(t *testing.T) {
							 | 
						|
									buf := make([]byte, 1024)
							 | 
						|
								
							 | 
						|
									isText := util.IsText(buf)
							 | 
						|
								
							 | 
						|
									if isText {
							 | 
						|
										t.Error("buf with zeros are not text")
							 | 
						|
									}
							 | 
						|
								
							 | 
						|
									compressed, _ := GzipData(buf)
							 | 
						|
								
							 | 
						|
									t.Logf("compressed size %d\n", len(compressed))
							 | 
						|
								}
							 |