avatar img use cache

This commit is contained in:
deepzz0
2017-07-13 01:37:35 +08:00
parent c18d9c0bef
commit e0a5f0ebca
7 changed files with 35 additions and 10 deletions
+11
View File
@@ -968,6 +968,17 @@ func (s *S) TestUnmarshalSliceOnPreset(c *C) {
c.Assert(v.A, DeepEquals, []int{2})
}
func (s *S) TestUnmarshalStrict(c *C) {
v := struct{ A, B int }{}
err := yaml.UnmarshalStrict([]byte("a: 1\nb: 2"), &v)
c.Check(err, IsNil)
err = yaml.Unmarshal([]byte("a: 1\nb: 2\nc: 3"), &v)
c.Check(err, IsNil)
err = yaml.UnmarshalStrict([]byte("a: 1\nb: 2\nc: 3"), &v)
c.Check(err, ErrorMatches, "yaml: unmarshal errors:\n line 1: field c not found in struct struct { A int; B int }")
}
//var data []byte
//func init() {
// var err error