Explorar o código

test []byte behavior

Tao Wen %!s(int64=8) %!d(string=hai) anos
pai
achega
9472474ffd
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      value_tests/slice_test.go

+ 8 - 0
value_tests/slice_test.go

@@ -6,6 +6,7 @@ func init() {
 		[]interface{}{"hello"},
 		nilSlice,
 		&nilSlice,
+		selectedMarshalCase{[]byte{1,2,3}},
 	)
 	unmarshalCases = append(unmarshalCases, unmarshalCase{
 		ptr:   (*[]string)(nil),
@@ -13,5 +14,12 @@ func init() {
 	}, unmarshalCase{
 		ptr:   (*[]string)(nil),
 		input: "[]",
+	}, unmarshalCase{
+		ptr:   (*[]byte)(nil),
+		input: "[1,2,3]",
+	}, unmarshalCase{
+		ptr:   (*[]byte)(nil),
+		input: `"aGVsbG8="`,
+		selected: true,
 	})
 }