Fixed tests
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
|||||||
"crypto/ecdh"
|
"crypto/ecdh"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@@ -792,7 +793,8 @@ func TestRandomMessageSizes(t *testing.T) {
|
|||||||
sizes := []int{0, 1, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 256, 512, 1000, 4096}
|
sizes := []int{0, 1, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 256, 512, 1000, 4096}
|
||||||
|
|
||||||
for _, size := range sizes {
|
for _, size := range sizes {
|
||||||
t.Run(string(rune(size)), func(t *testing.T) {
|
size := size // capture range variable
|
||||||
|
t.Run(fmt.Sprintf("%d_bytes", size), func(t *testing.T) {
|
||||||
plaintext := make([]byte, size)
|
plaintext := make([]byte, size)
|
||||||
if size > 0 {
|
if size > 0 {
|
||||||
rand.Read(plaintext)
|
rand.Read(plaintext)
|
||||||
|
|||||||
Reference in New Issue
Block a user