ekster/pkg/rss/rss_1.0_test.go
Peter Stuifzand 9ef3369389
Some checks failed
continuous-integration/drone/push Build is failing
Cleanup for go modules
2020-07-27 22:09:02 +02:00

31 lines
519 B
Go

package rss
import (
"io/ioutil"
"path/filepath"
"testing"
)
func TestParseRSS(t *testing.T) {
tests := map[string]string{
"rss_1.0": "Golem.de",
}
for test, want := range tests {
name := filepath.Join("testdata", test)
data, err := ioutil.ReadFile(name)
if err != nil {
t.Fatalf("Reading %s: %v", name, err)
}
feed, err := Parse(data)
if err != nil {
t.Fatalf("Parsing %s: %v", name, err)
}
if feed.Title != want {
t.Errorf("%s: got %q, want %q", name, feed.Title, want)
}
}
}