-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95373ea
commit e8bf007
Showing
8 changed files
with
66 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
test: | ||
go test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +0,0 @@ | ||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= | ||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= | ||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= | ||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= | ||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= | ||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
github.com/streadway/amqp v1.1.0 h1:py12iX8XSyI7aN/3dUT8DFIDJazNJsVJdxNVEpnQTZM= | ||
github.com/streadway/amqp v1.1.0/go.mod h1:WYSrTEYHOXHd0nwFeUXAe2G2hRnQT+deZJJf88uS9Bg= | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | ||
<url> | ||
<loc>https://www.example.com/</loc> | ||
<loc>https://www.example.com/a</loc> | ||
<lastmod>2024-10-19</lastmod> | ||
</url> | ||
<url> | ||
<loc>https://www.example.com/b</loc> | ||
<lastmod>2024-10-18</lastmod> | ||
</url> | ||
<url> | ||
<loc>https://www.example.com/c</loc> | ||
<lastmod>2024-10-17</lastmod> | ||
</url> | ||
</urlset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package lutetiumgo | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestSitemap_Creation(t *testing.T) { | ||
sitemap := &Sitemap{ | ||
Path: "https://location/sitemap.xml", | ||
} | ||
|
||
if sitemap.Path != "https://location/sitemap.xml" { | ||
t.Errorf("Expected is %s, got %s", "https://location/sitemap.xml", sitemap.Path) | ||
} | ||
} | ||
|
||
func TestSitemap_Read(t *testing.T) { | ||
sitemap := &Sitemap{ | ||
Path: "sitemaps.xml", | ||
} | ||
|
||
UrlSet := sitemap.Read() | ||
|
||
if UrlSet.Xmlns != "http://www.sitemaps.org/schemas/sitemap/0.9" { | ||
t.Errorf("Expected is %s, got %s", "http://www.sitemaps.org/schemas/sitemap/0.9", UrlSet.Xmlns) | ||
} | ||
|
||
if len(UrlSet.Urls) != 3 { | ||
t.Errorf("Expected UrlSet.Urls count is 3, got %d", len(UrlSet.Urls)) | ||
} | ||
|
||
var ExpectedUrls = [3]string{"https://www.example.com/a", "https://www.example.com/b", "https://www.example.com/c"} | ||
var ExpectedLastMods = [3]string{"2024-10-19", "2024-10-18", "2024-10-17"} | ||
|
||
i := 0 | ||
for _, Urls := range UrlSet.Urls { | ||
if Urls.Loc != ExpectedUrls[i] { | ||
t.Errorf("Expected is %s, got %s", ExpectedUrls[i], Urls.Loc) | ||
} | ||
if Urls.LastMod != ExpectedLastMods[i] { | ||
t.Errorf("Expected is %s, got %s", ExpectedLastMods[i], Urls.LastMod) | ||
} | ||
i++ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters