mirror of
https://codeberg.org/librarian/feeds
synced 2024-12-06 19:16:24 +01:00
44 lines
1.2 KiB
Go
44 lines
1.2 KiB
Go
package syndicate
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestFeed(t *testing.T) {
|
|
now := time.Now()
|
|
feed := &Feed{
|
|
Title: "jmoiron.net blog",
|
|
Link: &Link{Href: "http://jmoiron.net/blog"},
|
|
Description: "discussion about tech, footie, photos",
|
|
Author: &Author{"Jason Moiron", "jmoiron@jmoiron.net"},
|
|
Created: now,
|
|
}
|
|
|
|
feed.Items = []*Item{
|
|
&Item{
|
|
Title: "Limiting Concurrency in Go",
|
|
Link: &Link{Href: "http://jmoiron.net/blog/limiting-concurrency-in-go/"},
|
|
Description: "A discussion on controlled parallelism in golang",
|
|
Author: &Author{"Jason Moiron", "jmoiron@jmoiron.net"},
|
|
Created: now,
|
|
},
|
|
&Item{
|
|
Title: "Logic-less Template Redux",
|
|
Link: &Link{Href: "http://jmoiron.net/blog/logicless-template-redux/"},
|
|
Description: "More thoughts on logicless templates",
|
|
Created: now,
|
|
},
|
|
&Item{
|
|
Title: "Idiomatic Code Reuse in Go",
|
|
Link: &Link{Href: "http://jmoiron.net/blog/idiomatic-code-reuse-in-go/"},
|
|
Description: "How to use interfaces <em>effectively</em>",
|
|
Created: now,
|
|
},
|
|
}
|
|
|
|
fmt.Println(feed.ToAtom())
|
|
fmt.Println(feed.ToRss())
|
|
}
|