| 1 | package slackscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.16 testing/" |
| 5 | ) |
| 6 | |
| 7 | func TestJSONTime_UnmarshalJSONscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/TestJSONTime_UnmarshalJSON().(t *testingscip-go gomod github.com/golang/go/src go1.16 testing/.Tscip-go gomod github.com/golang/go/src go1.16 testing/T#) { |
| 8 | type args struct { |
| 9 | buf []byte |
| 10 | } |
| 11 | tests := []struct { |
| 12 | name string |
| 13 | args args |
| 14 | wantTr JSONTimescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/JSONTime# |
| 15 | wantErr bool |
| 16 | }{ |
| 17 | { |
| 18 | "acceptable int64 timestamp", |
| 19 | args{[]byte(`1643435556`)}, |
| 20 | JSONTimescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/JSONTime#(1643435556), |
| 21 | false, |
| 22 | }, |
| 23 | { |
| 24 | "acceptable string timestamp", |
| 25 | args{[]byte(`"1643435556"`)}, |
| 26 | JSONTimescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/JSONTime#(1643435556), |
| 27 | false, |
| 28 | }, |
| 29 | { |
| 30 | "null", |
| 31 | args{[]byte(`null`)}, |
| 32 | JSONTimescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/JSONTime#(0), |
| 33 | false, |
| 34 | }, |
| 35 | } |
| 36 | for _, tt := range tests { |
| 37 | t.Runscip-go gomod github.com/golang/go/src go1.16 testing/T#Run().(tt.name, func(t *testingscip-go gomod github.com/golang/go/src go1.16 testing/.Tscip-go gomod github.com/golang/go/src go1.16 testing/T#) { |
| 38 | var tr JSONTimescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/JSONTime# |
| 39 | if err := tr.UnmarshalJSONscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/JSONTime#UnmarshalJSON().(tt.args.buf); (err != nil) != tt.wantErr { |
| 40 | t.Errorfscip-go gomod github.com/golang/go/src go1.16 testing/common#Errorf().("JSONTime.UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) |
| 41 | } |
| 42 | }) |
| 43 | } |
| 44 | } |