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

5 years ago
  1. package util
  2. import (
  3. "testing"
  4. "golang.org/x/tools/godoc/util"
  5. )
  6. func TestIsGzippable(t *testing.T) {
  7. buf := make([]byte, 1024)
  8. isText := util.IsText(buf)
  9. if isText {
  10. t.Error("buf with zeros are not text")
  11. }
  12. compressed, _ := GzipData(buf)
  13. t.Logf("compressed size %d\n", len(compressed))
  14. }