|
@ -1,6 +1,7 @@ |
|
|
package model |
|
|
package model |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"fmt" |
|
|
"net/url" |
|
|
"net/url" |
|
|
"testing" |
|
|
"testing" |
|
|
"time" |
|
|
"time" |
|
@ -29,7 +30,6 @@ var testPage = Page{ |
|
|
FictionalDate: fictionalDate, |
|
|
FictionalDate: fictionalDate, |
|
|
PublishDate: postingDate, |
|
|
PublishDate: postingDate, |
|
|
EditDate: editDate, |
|
|
EditDate: editDate, |
|
|
Dated: true, |
|
|
|
|
|
Published: true, |
|
|
Published: true, |
|
|
Unlisted: false, |
|
|
Unlisted: false, |
|
|
Specific: false, |
|
|
Specific: false, |
|
@ -262,6 +262,18 @@ func TestPage(t *testing.T) { |
|
|
assertEquals(t, "page.Content()", string(content), "<h1>Returning Va’ynna’s Omni-Tool</h1>\n\n<p>Additional Content is additional</p>\n") |
|
|
assertEquals(t, "page.Content()", string(content), "<h1>Returning Va’ynna’s Omni-Tool</h1>\n\n<p>Additional Content is additional</p>\n") |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
t.Run("ContentSpecial", func(t *testing.T) { |
|
|
|
|
|
page := Page{Source: "Husarskie Anioły win the EUCC 2175", Type: "Markdown"} |
|
|
|
|
|
|
|
|
|
|
|
content, err := page.Content() |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
t.Errorf("page.Content: %s", err) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
t.Log(string(content)) |
|
|
|
|
|
assertEquals(t, "page.Content()", string(content), fmt.Sprintf("<p>%s</p>\n", page.Source)) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
t.Run("WikiURL", func(t *testing.T) { |
|
|
t.Run("WikiURL", func(t *testing.T) { |
|
|
t.Skip("To be implemented") |
|
|
t.Skip("To be implemented") |
|
|
}) |
|
|
}) |
|
|