Browse Source

changelog: add test for slackwareaarch64

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
master
Vincent Batts 2 months ago
parent
commit
e826043c5c
Signed by: vbatts
GPG Key ID: 10937E57733F1362
  1. 62
      changelog/feeds_test.go
  2. 6544
      changelog/testdata/slackwareaarch64-current/ChangeLog.txt

62
changelog/feeds_test.go

@ -6,33 +6,49 @@ import (
"testing"
)
var changelogs = []struct {
File string
Url string
}{
{
File: "testdata/slackwareaarch64-current/ChangeLog.txt",
Url: "http://ftp.arm.slackware.com/slackwarearm/slackwareaarch64-current/ChangeLog.txt",
},
{
File: "testdata/slackware64/ChangeLog.txt",
Url: "http://slackware.osuosl.org/slackware64-current/ChangeLog.txt",
},
}
func TestFeed(t *testing.T) {
fh, err := os.Open("testdata/slackware64/ChangeLog.txt")
if err != nil {
t.Fatal(err)
}
defer fh.Close()
for _, cl := range changelogs {
fh, err := os.Open(cl.File)
if err != nil {
t.Fatal(err)
}
defer fh.Close()
e, err := Parse(fh)
if err != nil {
t.Fatal(err)
}
e, err := Parse(fh)
if err != nil {
t.Fatal(err)
}
f, err := ToFeed("http://slackware.osuosl.org/slackware64-current/ChangeLog.txt", e)
if err != nil {
t.Fatal(err)
}
f, err := ToFeed(cl.Url, e)
if err != nil {
t.Fatal(err)
}
rss, err := f.ToRss()
if err != nil {
t.Fatal(err)
}
//println(rss)
if len(rss) == 0 {
t.Error("rss output is empty")
}
rss, err := f.ToRss()
if err != nil {
t.Fatal(err)
}
//println(rss)
if len(rss) == 0 {
t.Error("rss output is empty")
}
if err := f.WriteRss(ioutil.Discard); err != nil {
t.Error(err)
if err := f.WriteRss(ioutil.Discard); err != nil {
t.Error(err)
}
}
}

6544
changelog/testdata/slackwareaarch64-current/ChangeLog.txt vendored

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save