Blob Blame History Raw
From 503ad38530d6796fbef6fe74dd20d07b98e4143b Mon Sep 17 00:00:00 2001
From: Andy Lester <andy@petdance.com>
Date: Tue, 7 Apr 2015 09:57:09 -0500
Subject: [PATCH] doc-tag-required errors are now sorted by tag name.

---
 Changes                 | 9 +++++++++
 lib/HTML/Lint/Parser.pm | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Changes b/Changes
index 01f254c..3093c8a 100644
--- a/Changes
+++ b/Changes
@@ -6,6 +6,15 @@ NOTE: All bugs and requests are now being handled through GitHub.
 
 Please DO NOT send bug reports to http://rt.cpan.org/.
 
+NEXT
+
+    [FIXES]
+    Errors of the type doc-tag-required did not come out in any defined
+    order.  They are now sorted by tag name.  This was discovered
+    because hash randomization caused tests to fail on Perl 5.18 and
+    above. Thanks, Slaven Rezic and Andrew Main.
+
+
 2.22    Mon Apr  6 15:47:11 CDT 2015
     [CHANGES THAT COULD BREAK YOUR CODE]
     Previously, html_ok() would not check the entire structure of a web
diff --git a/lib/HTML/Lint/Parser.pm b/lib/HTML/Lint/Parser.pm
index aa1e337..5c60915 100644
--- a/lib/HTML/Lint/Parser.pm
+++ b/lib/HTML/Lint/Parser.pm
@@ -102,7 +102,7 @@ sub _start_document {
 sub _end_document {
     my ($self,$line,$column) = @_;
 
-    for my $tag ( keys %isRequired ) {
+    for my $tag ( sort keys %isRequired ) {
         if ( !$self->{_first_seen}->{$tag} ) {
             $self->gripe( 'doc-tag-required', tag => $tag );
         }
-- 
2.1.0