mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-04-08 10:06:55 +02:00
27 lines
523 B
Go
27 lines
523 B
Go
package device
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func Test_randomJunktWithSize(t *testing.T) {
|
|
junk, err := randomJunkWithSize(30)
|
|
fmt.Println(string(junk), len(junk), err)
|
|
}
|
|
|
|
func Test_appendJunk(t *testing.T) {
|
|
t.Run("", func(t *testing.T) {
|
|
s := "apple"
|
|
buffer := bytes.NewBuffer([]byte(s))
|
|
err := appendJunk(buffer, 30)
|
|
if err != nil &&
|
|
buffer.Len() != len(s)+30 {
|
|
t.Errorf("appendWithJunk() size don't match")
|
|
}
|
|
read := make([]byte, 50)
|
|
buffer.Read(read)
|
|
fmt.Println(string(read))
|
|
})
|
|
}
|