Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
miniflux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
miniflux
Commits
af74e39f
Commit
af74e39f
authored
1 year ago
by
fred
Committed by
Frédéric Guillot
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add test case to parse Atom icon URL
parent
8646d611
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reader/atom/atom_10_test.go
+22
-0
22 additions, 0 deletions
reader/atom/atom_10_test.go
with
22 additions
and
0 deletions
reader/atom/atom_10_test.go
+
22
−
0
View file @
af74e39f
...
@@ -48,6 +48,10 @@ func TestParseAtomSample(t *testing.T) {
...
@@ -48,6 +48,10 @@ func TestParseAtomSample(t *testing.T) {
t
.
Errorf
(
"Incorrect site URL, got: %s"
,
feed
.
SiteURL
)
t
.
Errorf
(
"Incorrect site URL, got: %s"
,
feed
.
SiteURL
)
}
}
if
feed
.
IconURL
!=
""
{
t
.
Errorf
(
"Incorrect icon URL, got: %s"
,
feed
.
IconURL
)
}
if
len
(
feed
.
Entries
)
!=
1
{
if
len
(
feed
.
Entries
)
!=
1
{
t
.
Errorf
(
"Incorrect number of entries, got: %d"
,
len
(
feed
.
Entries
))
t
.
Errorf
(
"Incorrect number of entries, got: %d"
,
len
(
feed
.
Entries
))
}
}
...
@@ -1648,3 +1652,21 @@ func TestParseFeedWithCategories(t *testing.T) {
...
@@ -1648,3 +1652,21 @@ func TestParseFeedWithCategories(t *testing.T) {
t
.
Errorf
(
"Incorrect entry category, got %q instead of %q"
,
result
,
expected
)
t
.
Errorf
(
"Incorrect entry category, got %q instead of %q"
,
result
,
expected
)
}
}
}
}
func
TestParseFeedWithIconURL
(
t
*
testing
.
T
)
{
data
:=
`<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Feed</title>
<link href="http://example.org/"/>
<icon>http://example.org/icon.png</icon>
</feed>`
feed
,
err
:=
Parse
(
"https://example.org/"
,
bytes
.
NewBufferString
(
data
))
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
if
feed
.
IconURL
!=
"http://example.org/icon.png"
{
t
.
Errorf
(
"Incorrect icon URL, got: %s"
,
feed
.
IconURL
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment