~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/json/decode_test.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
type badTag struct {
44
44
        X string
45
 
        Y string "y"
46
 
        Z string "@#*%(#@"
 
45
        Y string `json:"y"`
 
46
        Z string `x:"@#*%(#@"`
 
47
        W string `json:"@#$@#$"`
47
48
}
48
49
 
49
50
type unmarshalTest struct {
68
69
        {`{"x": 1}`, new(tx), tx{}, &UnmarshalFieldError{"x", txType, txType.Field(0)}},
69
70
 
70
71
        // skip invalid tags
71
 
        {`{"X":"a", "y":"b", "Z":"c"}`, new(badTag), badTag{"a", "b", "c"}, nil},
 
72
        {`{"X":"a", "y":"b", "Z":"c", "W":"d"}`, new(badTag), badTag{"a", "b", "c", "d"}, nil},
72
73
 
73
74
        // syntax errors
74
75
        {`{"X": "foo", "Y"}`, nil, nil, &SyntaxError{"invalid character '}' after object key", 17}},
250
251
        Float32 float32
251
252
        Float64 float64
252
253
 
253
 
        Foo string "bar"
 
254
        Foo string `json:"bar"`
254
255
 
255
256
        PBool    *bool
256
257
        PInt     *int