Skip to content

Commit de9e29b

Browse files
joeybloggsjoeybloggs
authored andcommitted
Add Decoder PointerToPointer test
1 parent 609628c commit de9e29b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

decoder_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,3 +1410,21 @@ func TestDecoderInterface(t *testing.T) {
14101410
Equal(t, ok, true)
14111411
Equal(t, err.Error(), "form: Decode(non-pointer form.test)")
14121412
}
1413+
1414+
func TestDecoderPointerToPointer(t *testing.T) {
1415+
1416+
values := map[string][]string{
1417+
"Value": {"testVal"},
1418+
}
1419+
1420+
type Test struct {
1421+
Value string
1422+
}
1423+
1424+
var tst *Test
1425+
1426+
d := NewDecoder()
1427+
err := d.Decode(&tst, values)
1428+
Equal(t, err, nil)
1429+
Equal(t, tst.Value, "testVal")
1430+
}

0 commit comments

Comments
 (0)