@@ -413,78 +413,6 @@ func TestUnmarshalInvalidISO8601(t *testing.T) {
413413 }
414414}
415415
416- func TestUnmarshalParsesRFC3339 (t * testing.T ) {
417- payload := & OnePayload {
418- Data : & Node {
419- Type : "timestamps" ,
420- Attributes : map [string ]interface {}{
421- "timestamp" : "2020-03-16T23:09:59+00:00" ,
422- },
423- },
424- }
425-
426- in := bytes .NewBuffer (nil )
427- json .NewEncoder (in ).Encode (payload )
428-
429- out := new (TimestampRFC3339 )
430-
431- if err := UnmarshalPayload (in , out ); err != nil {
432- t .Fatal (err )
433- }
434-
435- expected := time .Date (2020 , 3 , 16 , 23 , 9 , 59 , 0 , time .UTC )
436-
437- if ! out .Time .Equal (expected ) {
438- t .Fatal ("Parsing the RFC3339 timestamp failed" )
439- }
440- }
441-
442- func TestUnmarshalParsesRFC3339TimePointer (t * testing.T ) {
443- payload := & OnePayload {
444- Data : & Node {
445- Type : "timestamps" ,
446- Attributes : map [string ]interface {}{
447- "next" : "2020-03-16T23:09:59+00:00" ,
448- },
449- },
450- }
451-
452- in := bytes .NewBuffer (nil )
453- json .NewEncoder (in ).Encode (payload )
454-
455- out := new (TimestampRFC3339 )
456-
457- if err := UnmarshalPayload (in , out ); err != nil {
458- t .Fatal (err )
459- }
460-
461- expected := time .Date (2020 , 3 , 16 , 23 , 9 , 59 , 0 , time .UTC )
462-
463- if ! out .Next .Equal (expected ) {
464- t .Fatal ("Parsing the RFC3339 timestamp failed" )
465- }
466- }
467-
468- func TestUnmarshalInvalidRFC3339 (t * testing.T ) {
469- payload := & OnePayload {
470- Data : & Node {
471- Type : "timestamps" ,
472- Attributes : map [string ]interface {}{
473- "timestamp" : "17 Aug 16 08:027 MST" ,
474- },
475- },
476- }
477-
478- in := bytes .NewBuffer (nil )
479- json .NewEncoder (in ).Encode (payload )
480-
481- out := new (TimestampRFC3339 )
482-
483- if err := UnmarshalPayload (in , out ); err != ErrInvalidRFC3339 {
484- t .Fatalf ("Expected ErrInvalidRFC3339, got %v" , err )
485- }
486- }
487-
488416func TestUnmarshalRelationshipsWithoutIncluded (t * testing.T ) {
489417 data , err := json .Marshal (samplePayloadWithoutIncluded ())
490418 if err != nil {
0 commit comments