Skip to content

Commit d6cec3e

Browse files
committed
opml: add feedly test case
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
1 parent 817e827 commit d6cec3e

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

marshal_feedreader_test.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,65 @@ import (
1010
)
1111

1212
var (
13+
feedReaderDocumentFeedly = Document{
14+
XMLName: xml.Name{Local: "opml"},
15+
Version: Version1,
16+
Head: Head{
17+
Title: "My subscriptions in feedly Cloud",
18+
},
19+
Body: Body{
20+
Outlines: []Outline{
21+
{
22+
Text: "Programming",
23+
Title: "Programming",
24+
Outlines: []Outline{
25+
{
26+
Text: "Elixir Lang",
27+
Title: "Elixir Lang",
28+
Type: OutlineTypeSubscription,
29+
HtmlUrl: "http://elixir-lang.org",
30+
XmlUrl: "https://feeds.feedburner.com/ElixirLang",
31+
},
32+
{
33+
Text: "Zephyr Project",
34+
Title: "Zephyr Project",
35+
Type: OutlineTypeSubscription,
36+
HtmlUrl: "https://www.zephyrproject.org",
37+
XmlUrl: "https://www.zephyrproject.org/feed/",
38+
},
39+
{
40+
Text: "Python Insider",
41+
Title: "Python Insider",
42+
Type: OutlineTypeSubscription,
43+
HtmlUrl: "https://pythoninsider.blogspot.com/",
44+
XmlUrl: "https://feeds.feedburner.com/PythonInsider",
45+
},
46+
},
47+
},
48+
{
49+
Text: "Games",
50+
Title: "Games",
51+
Outlines: []Outline{
52+
{
53+
Text: "BeamNG.drive",
54+
Title: "BeamNG.drive",
55+
Type: OutlineTypeSubscription,
56+
HtmlUrl: "https://www.beamng.com/game/",
57+
XmlUrl: "https://www.beamng.com/game/index.xml",
58+
},
59+
{
60+
Text: "Vintage Story",
61+
Title: "Vintage Story",
62+
Type: OutlineTypeSubscription,
63+
HtmlUrl: "https://www.vintagestory.at/blog.html/",
64+
XmlUrl: "https://www.vintagestory.at/blog.html/?rss=1",
65+
},
66+
},
67+
},
68+
},
69+
},
70+
}
71+
1372
feedReaderDocumentNewsblur = Document{
1473
XMLName: xml.Name{Local: "opml"},
1574
Version: Version1_1,
@@ -91,6 +150,11 @@ func TestUnmarshalFeedReader(t *testing.T) {
91150
inputFileName string
92151
want Document
93152
}{
153+
{
154+
tname: "feedly",
155+
inputFileName: "feedly.opml",
156+
want: feedReaderDocumentFeedly,
157+
},
94158
{
95159
tname: "newsblur",
96160
inputFileName: "newsblur.opml",

opml_document.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type (
1717
)
1818

1919
const (
20+
Version1 string = "1.0"
2021
Version1_1 string = "1.1"
2122
Version2 string = "2.0"
2223

testdata/feedreader/feedly.opml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<opml version="1.0">
4+
<head>
5+
<title>My subscriptions in feedly Cloud</title>
6+
</head>
7+
<body>
8+
<outline text="Programming" title="Programming">
9+
<outline type="rss" text="Elixir Lang" title="Elixir Lang" xmlUrl="https://feeds.feedburner.com/ElixirLang" htmlUrl="http://elixir-lang.org"/>
10+
<outline type="rss" text="Zephyr Project" title="Zephyr Project" xmlUrl="https://www.zephyrproject.org/feed/" htmlUrl="https://www.zephyrproject.org"/>
11+
<outline type="rss" text="Python Insider" title="Python Insider" xmlUrl="https://feeds.feedburner.com/PythonInsider" htmlUrl="https://pythoninsider.blogspot.com/"/>
12+
</outline>
13+
<outline text="Games" title="Games">
14+
<outline type="rss" text="BeamNG.drive" title="BeamNG.drive" xmlUrl="https://www.beamng.com/game/index.xml" htmlUrl="https://www.beamng.com/game/"/>
15+
<outline type="rss" text="Vintage Story" title="Vintage Story" xmlUrl="https://www.vintagestory.at/blog.html/?rss=1" htmlUrl="https://www.vintagestory.at/blog.html/"/>
16+
</outline>
17+
</body>
18+
</opml>

0 commit comments

Comments
 (0)