gohttpserver/zip_test.go
2019-02-15 17:41:35 +08:00

21 lines
380 B
Go

package main
import (
"bytes"
"testing"
"github.com/stretchr/testify/assert"
)
func TestExtractFromZip(t *testing.T) {
buf := bytes.NewBuffer(nil)
err := ExtractFromZip("testdata/test.zip", "**/foo.txt", buf)
assert.Nil(t, err)
t.Log("Content: " + buf.String())
}
//func TestUnzipTo(t *testing.T){
// err := unzipFile("testdata.zip", "./tmp")
// assert.Nil(t, err)
//}