gofmt -s -w src misc

R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
This commit is contained in:
Robert Griesemer 2010-10-22 10:06:33 -07:00
parent f613015e0e
commit 3478891d12
121 changed files with 8388 additions and 8388 deletions

View file

@ -32,30 +32,30 @@ type unmarshalTest struct {
var unmarshalTests = []unmarshalTest{
// basic types
unmarshalTest{`true`, new(bool), true, nil},
unmarshalTest{`1`, new(int), 1, nil},
unmarshalTest{`1.2`, new(float), 1.2, nil},
unmarshalTest{`-5`, new(int16), int16(-5), nil},
unmarshalTest{`"a\u1234"`, new(string), "a\u1234", nil},
unmarshalTest{`"http:\/\/"`, new(string), "http://", nil},
unmarshalTest{`"g-clef: \uD834\uDD1E"`, new(string), "g-clef: \U0001D11E", nil},
unmarshalTest{`"invalid: \uD834x\uDD1E"`, new(string), "invalid: \uFFFDx\uFFFD", nil},
unmarshalTest{"null", new(interface{}), nil, nil},
unmarshalTest{`{"X": [1,2,3], "Y": 4}`, new(T), T{Y: 4}, &UnmarshalTypeError{"array", reflect.Typeof("")}},
unmarshalTest{`{"x": 1}`, new(tx), tx{}, &UnmarshalFieldError{"x", txType, txType.Field(0)}},
{`true`, new(bool), true, nil},
{`1`, new(int), 1, nil},
{`1.2`, new(float), 1.2, nil},
{`-5`, new(int16), int16(-5), nil},
{`"a\u1234"`, new(string), "a\u1234", nil},
{`"http:\/\/"`, new(string), "http://", nil},
{`"g-clef: \uD834\uDD1E"`, new(string), "g-clef: \U0001D11E", nil},
{`"invalid: \uD834x\uDD1E"`, new(string), "invalid: \uFFFDx\uFFFD", nil},
{"null", new(interface{}), nil, nil},
{`{"X": [1,2,3], "Y": 4}`, new(T), T{Y: 4}, &UnmarshalTypeError{"array", reflect.Typeof("")}},
{`{"x": 1}`, new(tx), tx{}, &UnmarshalFieldError{"x", txType, txType.Field(0)}},
// syntax errors
unmarshalTest{`{"X": "foo", "Y"}`, nil, nil, SyntaxError("invalid character '}' after object key")},
{`{"X": "foo", "Y"}`, nil, nil, SyntaxError("invalid character '}' after object key")},
// composite tests
unmarshalTest{allValueIndent, new(All), allValue, nil},
unmarshalTest{allValueCompact, new(All), allValue, nil},
unmarshalTest{allValueIndent, new(*All), &allValue, nil},
unmarshalTest{allValueCompact, new(*All), &allValue, nil},
unmarshalTest{pallValueIndent, new(All), pallValue, nil},
unmarshalTest{pallValueCompact, new(All), pallValue, nil},
unmarshalTest{pallValueIndent, new(*All), &pallValue, nil},
unmarshalTest{pallValueCompact, new(*All), &pallValue, nil},
{allValueIndent, new(All), allValue, nil},
{allValueCompact, new(All), allValue, nil},
{allValueIndent, new(*All), &allValue, nil},
{allValueCompact, new(*All), &allValue, nil},
{pallValueIndent, new(All), pallValue, nil},
{pallValueCompact, new(All), pallValue, nil},
{pallValueIndent, new(*All), &pallValue, nil},
{pallValueCompact, new(*All), &pallValue, nil},
}
func TestMarshal(t *testing.T) {
@ -259,15 +259,15 @@ var allValue = All{
Foo: "foo",
String: "16",
Map: map[string]Small{
"17": Small{Tag: "tag17"},
"18": Small{Tag: "tag18"},
"17": {Tag: "tag17"},
"18": {Tag: "tag18"},
},
MapP: map[string]*Small{
"19": &Small{Tag: "tag19"},
"20": nil,
},
EmptyMap: map[string]Small{},
Slice: []Small{Small{Tag: "tag20"}, Small{Tag: "tag21"}},
Slice: []Small{{Tag: "tag20"}, {Tag: "tag21"}},
SliceP: []*Small{&Small{Tag: "tag22"}, nil, &Small{Tag: "tag23"}},
EmptySlice: []Small{},
StringSlice: []string{"str24", "str25", "str26"},