Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minor changes

  • Loading branch information...
commit 7e3cb74006542c8e619b2571415beacc95fc1456 1 parent fc08e8c
@afiskon authored
Showing with 3 additions and 4 deletions.
  1. +2 −2 lib/Sitemap/XML/Parser.pm6
  2. +1 −2  t/01-parse.t
View
4 lib/Sitemap/XML/Parser.pm6
@@ -30,7 +30,7 @@ method parse ( Str $data ) {
my %info;
for @( %url{'data'} ) -> %item {
- unless %item{'name'} eq any('loc', 'lastmod', 'changefreq', 'priority') {
+ unless %item{'name'} eq [|] qw/loc lastmod changefreq priority/ {
die "Unexpected tag '" ~ %item{'name'} ~ "' found";
}
unless @( %item{'data'} ).elems == 1 && %item{'data'}[0].isa('Str') {
@@ -68,7 +68,7 @@ method !check-lastmod ( %info is copy ) {
method !check-changefreq ( %info ) {
return %info unless any(%info.keys) eq 'changefreq';
- unless %info{'changefreq'} eq any(qw/always hourly daily weekly monthly yearly never/) {
+ unless %info{'changefreq'} eq [|] qw/always hourly daily weekly monthly yearly never/ {
die "Invalid tag value '" ~ %info{'changefreq'} ~ "' for 'changefreq'"
}
return %info;
View
3  t/01-parse.t
@@ -118,8 +118,7 @@ for @invalid -> $sitemap {
dies_ok({ $parser.parse($sitemap) });
}
-my %valid = zip(@valid_sitemaps, @valid_results);
-for %valid.kv -> $sitemap, $struct {
+for @valid_sitemaps Z @valid_results -> $sitemap, $struct {
my $rslt = $parser.parse($sitemap);
for $rslt.values -> $item is rw {
Please sign in to comment.
Something went wrong with that request. Please try again.