diff options
| author | Ondřej Surý <ondrej@sury.org> | 2011-07-08 09:16:22 +0200 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2011-07-08 09:16:22 +0200 |
| commit | ab23f6dab91e6ec615481c4b3e77e4639c3f871b (patch) | |
| tree | f897fd3be56fdc3599a88df375c76bc172108fd1 /src/pkg/json/decode_test.go | |
| parent | 8d00b02d82d86abe51773dc2c1751843bb538ae5 (diff) | |
| download | golang-ab23f6dab91e6ec615481c4b3e77e4639c3f871b.tar.gz | |
Imported Upstream version 2011.07.07upstream-weekly/2011.07.07
Diffstat (limited to 'src/pkg/json/decode_test.go')
| -rw-r--r-- | src/pkg/json/decode_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pkg/json/decode_test.go b/src/pkg/json/decode_test.go index bf8bf10bf..9b84bc76c 100644 --- a/src/pkg/json/decode_test.go +++ b/src/pkg/json/decode_test.go @@ -42,8 +42,9 @@ var ( type badTag struct { X string - Y string "y" - Z string "@#*%(#@" + Y string `json:"y"` + Z string `x:"@#*%(#@"` + W string `json:"@#$@#$"` } type unmarshalTest struct { @@ -68,7 +69,7 @@ var unmarshalTests = []unmarshalTest{ {`{"x": 1}`, new(tx), tx{}, &UnmarshalFieldError{"x", txType, txType.Field(0)}}, // skip invalid tags - {`{"X":"a", "y":"b", "Z":"c"}`, new(badTag), badTag{"a", "b", "c"}, nil}, + {`{"X":"a", "y":"b", "Z":"c", "W":"d"}`, new(badTag), badTag{"a", "b", "c", "d"}, nil}, // syntax errors {`{"X": "foo", "Y"}`, nil, nil, &SyntaxError{"invalid character '}' after object key", 17}}, @@ -250,7 +251,7 @@ type All struct { Float32 float32 Float64 float64 - Foo string "bar" + Foo string `json:"bar"` PBool *bool PInt *int |
