websocket/compression_test.go

27 lines
374 B
Go
Raw Normal View History

2016-04-27 00:43:57 +03:00
package websocket
import (
"bytes"
"compress/flate"
"testing"
)
func Test_NewAdaptorWriter(t *testing.T) {
backendBuff := new(bytes.Buffer)
aw := NewAdaptorWriter(backendBuff)
fw, err := flate.NewWriter(aw, -1)
if err != nil {
t.Fatal(err)
}
var n int
n, err = fw.Write([]byte("test"))
t.Log(n, err)
if err = fw.Flush(); err != nil {
t.Fatal(err)
}
}