Skip to content

Commit

Permalink
Add test ensuring [] decodes as zero-length slice.
Browse files Browse the repository at this point in the history
Reported as #42 and previously fixed in 0885984.
  • Loading branch information
niemeyer committed Jan 16, 2015
1 parent 1bf6a7c commit bef53ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions decode_test.go
Expand Up @@ -540,6 +540,12 @@ var unmarshalTests = []struct {
"a: 1.2.3.4\n",
map[string]net.IP{"a": net.IPv4(1, 2, 3, 4)},
},

// Encode empty lists as zero-length slices.
{
"a: []",
&struct{ A []int }{[]int{}},
},
}

type M map[interface{}]interface{}
Expand Down

0 comments on commit bef53ef

Please sign in to comment.