|
@@ -123,10 +123,7 @@ func TestParseWebPageWithRssFeed(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -160,10 +157,7 @@ func TestParseWebPageWithAtomFeed(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -197,10 +191,7 @@ func TestParseWebPageWithJSONFeed(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -234,10 +225,7 @@ func TestParseWebPageWithOldJSONFeedMimeType(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -272,10 +260,7 @@ func TestParseWebPageWithJSONFeedWpJsonIgnored(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 0 {
|
|
if len(subscriptions) != 0 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -297,10 +282,7 @@ func TestParseWebPageWithRelativeFeedURL(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -334,10 +316,7 @@ func TestParseWebPageWithEmptyTitle(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -372,10 +351,7 @@ func TestParseWebPageWithMultipleFeeds(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 2 {
|
|
if len(subscriptions) != 2 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -398,10 +374,7 @@ func TestParseWebPageWithDuplicatedFeeds(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 1 {
|
|
if len(subscriptions) != 1 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -435,10 +408,7 @@ func TestParseWebPageWithEmptyFeedURL(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 0 {
|
|
if len(subscriptions) != 0 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
@@ -460,10 +430,7 @@ func TestParseWebPageWithNoHref(t *testing.T) {
|
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
t.Fatalf(`Unable to parse the HTML: %v`, shouldNeverHappenErr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- subscriptions, err := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
- if err != nil {
|
|
|
|
|
- t.Fatalf(`Parsing a correctly formatted HTML page should not return any error: %v`, err)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ subscriptions := NewSubscriptionFinder(nil).findSubscriptionsFromWebPage("http://example.org/", doc)
|
|
|
|
|
|
|
|
if len(subscriptions) != 0 {
|
|
if len(subscriptions) != 0 {
|
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|
|
t.Fatal(`Incorrect number of subscriptions returned`)
|