refactor: move shared packages up a level

This commit is contained in:
sentriz
2022-04-13 00:09:10 +01:00
parent 165904c2bb
commit 8b803ecf20
53 changed files with 65 additions and 68 deletions

29
podcasts/podcasts_test.go Normal file
View File

@@ -0,0 +1,29 @@
package podcasts
import (
"os"
"testing"
"time"
"github.com/mmcdole/gofeed"
)
func TestGetMoreRecentEpisodes(t *testing.T) {
fp := gofeed.NewParser()
newFile, err := os.Open("testdata/rss.new")
if err != nil {
t.Fatalf("open test data: %v", err)
}
newFeed, err := fp.Parse(newFile)
if err != nil {
t.Fatalf("parse test data: %v", err)
}
after, err := time.Parse(time.RFC1123, "Mon, 27 Jun 2016 06:33:43 +0000")
if err != nil {
t.Fatalf("parse time: %v", err)
}
entries := getEntriesAfterDate(newFeed.Items, after)
if len(entries) != 2 {
t.Errorf("expected 2 entries, got %d", len(entries))
}
}