aboutsummaryrefslogtreecommitdiff
path: root/internal/nametransform/names_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/nametransform/names_test.go')
-rw-r--r--internal/nametransform/names_test.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/internal/nametransform/names_test.go b/internal/nametransform/names_test.go
index 0254777..9d77c2d 100644
--- a/internal/nametransform/names_test.go
+++ b/internal/nametransform/names_test.go
@@ -6,10 +6,11 @@ import (
)
func TestPad16(t *testing.T) {
- var s [][]byte
- s = append(s, []byte("foo"))
- s = append(s, []byte("12345678901234567"))
- s = append(s, []byte("12345678901234567abcdefg"))
+ s := [][]byte{
+ []byte("foo"),
+ []byte("12345678901234567"),
+ []byte("12345678901234567abcdefg"),
+ }
for i := range s {
orig := s[i]
@@ -35,13 +36,14 @@ func TestPad16(t *testing.T) {
// TestUnpad16Garbage - unPad16 should never crash on corrupt or malicious inputs
func TestUnpad16Garbage(t *testing.T) {
- var testCases [][]byte
- testCases = append(testCases, make([]byte, 0))
- testCases = append(testCases, make([]byte, 16))
- testCases = append(testCases, make([]byte, 1))
- testCases = append(testCases, make([]byte, 17))
- testCases = append(testCases, bytes.Repeat([]byte{16}, 16))
- testCases = append(testCases, bytes.Repeat([]byte{17}, 16))
+ testCases := [][]byte{
+ make([]byte, 0),
+ make([]byte, 16),
+ make([]byte, 1),
+ make([]byte, 17),
+ bytes.Repeat([]byte{16}, 16),
+ bytes.Repeat([]byte{17}, 16),
+ }
for _, v := range testCases {
_, err := unPad16([]byte(v))
if err == nil {