Simpler `stunnel` replacement.
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.
 

27 lines
434 B

package ttunnel
import (
"bytes"
"testing"
)
func TestRandReader(t *testing.T) {
seed := []byte("oushBafepGochCotlekcebvallAwJedd")
rr1 := NewRandReader(seed)
rr2 := NewRandReader(seed)
defer rr1.Close()
defer rr2.Close()
// Read some long buffers.
b1 := make([]byte, 32768)
b2 := make([]byte, 32768)
for i := 0; i < 8; i++ {
rr1.Read(b1)
rr2.Read(b2)
if !bytes.Equal(b1, b2) {
t.Fatal("Not equal!")
}
}
}