~chrisppy/go-barefeed

ref: 022d6ea6f0215c28fa4b4b69dd9d821c8766ded8 go-barefeed/message_test.go -rw-r--r-- 532 bytes
022d6ea6Chris Palmer updates from barefeed fixes 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package barefeed

import (
	"testing"
	"time"
)

func testMessage(t *testing.T, expected, actual Message) {
	if actual.Created != expected.Created {
		t.Errorf("Expected %v, actual %v", expected.Created, actual.Created)
	}
	if actual.Generator != expected.Generator {
		t.Errorf("Expected %s, actual %s", expected.Generator, actual.Generator)
	}
	testFeeds(t, expected.Feeds, actual.Feeds)
}

func getMessage() Message {
	return Message{
		Created:   ToTimestamp(time.Now()),
		Generator: "generated",
		Feeds:     getFeeds(),
	}
}