~niemeyer/mgo/trunk

« back to all changes in this revision

Viewing changes to bson/bson_test.go

  • Committer: Gustavo Niemeyer
  • Date: 2012-04-07 18:52:17 UTC
  • Revision ID: gustavo@niemeyer.net-20120407185217-vc9f7niu33r461hn
bson: support omitempty on time.Time.

Fixes issue 976131.

Show diffs side-by-side

added added

removed removed

Lines of Context:
884
884
type namedCondStr struct {
885
885
        V string "myv,omitempty"
886
886
}
 
887
type condTime struct {
 
888
        V time.Time ",omitempty"
 
889
}
887
890
 
888
891
type shortInt struct {
889
892
        V int64 ",minsize"
1052
1055
        {&condPtr{&falsevar}, map[string]bool{"v": false}},
1053
1056
        {&condPtr{}, map[string]string{}},
1054
1057
 
 
1058
        {&condTime{time.Unix(123456789, 123e6)}, map[string]time.Time{"v": time.Unix(123456789, 123e6)}},
 
1059
        {&condTime{}, map[string]string{}},
 
1060
 
1055
1061
        {&namedCondStr{"yo"}, map[string]string{"myv": "yo"}},
1056
1062
        {&namedCondStr{}, map[string]string{}},
1057
1063