summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2013-01-27 20:48:56 +0000
committerdakkar <dakkar@thenautilus.net>2013-01-27 20:49:15 +0000
commit3e335ea77b4f33c7ec7bd9d4d7219523bec54d80 (patch)
treee0afd8976fd3929c14a8b695d2a9d9b77d978b92
parentprep for version 0.4 (diff)
downloadTree-Template-Declare-3e335ea77b4f33c7ec7bd9d4d7219523bec54d80.tar.gz
Tree-Template-Declare-3e335ea77b4f33c7ec7bd9d4d7219523bec54d80.tar.bz2
Tree-Template-Declare-3e335ea77b4f33c7ec7bd9d4d7219523bec54d80.zip
more rebust tests, work with hash randomisationv0.5
-rw-r--r--.gitignore1
-rw-r--r--ChangeLog3
-rw-r--r--lib/Tree/Template/Declare.pm2
-rw-r--r--lib/Tree/Template/Declare/DAG_Node.pm2
-rw-r--r--lib/Tree/Template/Declare/HTML_Element.pm2
-rw-r--r--lib/Tree/Template/Declare/LibXML.pm2
-rw-r--r--t/03-html.t13
-rw-r--r--t/04-xml.t8
-rw-r--r--t/05-mixed.t4
9 files changed, 25 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 417e141..c304544 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
/blib/
/inc/
/META.yml
+/MYMETA.*
/pm_to_blib
/Makefile
/Makefile.old
diff --git a/ChangeLog b/ChangeLog
index e5adda8..2cd9dfe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
.. -*- mode: rst; coding: utf-8 -*-
+0.5 2013-01-27
+ - fixed tests broken by better hash randomisation in perl 5.18
+
0.4 2011-02-13
- fixed test for HTML::Element
- silenced some critic violations
diff --git a/lib/Tree/Template/Declare.pm b/lib/Tree/Template/Declare.pm
index c7dc227..46cf784 100644
--- a/lib/Tree/Template/Declare.pm
+++ b/lib/Tree/Template/Declare.pm
@@ -7,7 +7,7 @@ use Carp;
use Data::Dumper;
use 5.006;
-our $VERSION='0.4';
+our $VERSION='0.5';
{
my $exporter=Sub::Exporter::build_exporter({
diff --git a/lib/Tree/Template/Declare/DAG_Node.pm b/lib/Tree/Template/Declare/DAG_Node.pm
index aca8082..4345638 100644
--- a/lib/Tree/Template/Declare/DAG_Node.pm
+++ b/lib/Tree/Template/Declare/DAG_Node.pm
@@ -3,7 +3,7 @@ use strict;
use warnings;
use Carp;
-our $VERSION='0.4';
+our $VERSION='0.5';
sub new {
my ($class,$node_class)=@_;
diff --git a/lib/Tree/Template/Declare/HTML_Element.pm b/lib/Tree/Template/Declare/HTML_Element.pm
index 01f4a15..18dab82 100644
--- a/lib/Tree/Template/Declare/HTML_Element.pm
+++ b/lib/Tree/Template/Declare/HTML_Element.pm
@@ -4,7 +4,7 @@ use warnings;
use Carp;
use HTML::Element;
-our $VERSION='0.4';
+our $VERSION='0.5';
sub new {
my ($class)=@_;
diff --git a/lib/Tree/Template/Declare/LibXML.pm b/lib/Tree/Template/Declare/LibXML.pm
index 77194c7..9e5fb93 100644
--- a/lib/Tree/Template/Declare/LibXML.pm
+++ b/lib/Tree/Template/Declare/LibXML.pm
@@ -4,7 +4,7 @@ use warnings;
use Carp;
use XML::LibXML;
-our $VERSION='0.4';
+our $VERSION='0.5';
sub new {
my ($class)=@_;
diff --git a/t/03-html.t b/t/03-html.t
index a4b6df9..6c1348d 100644
--- a/t/03-html.t
+++ b/t/03-html.t
@@ -32,7 +32,16 @@ my $tree=tree {
};
};
-like($tree->as_HTML(),
- qr{\A<html><head><title>Page title</title></head><body><p class="para" id="p1">Page para</body></html>\s*\z},
+my $expected_tree = HTML::Element->new_from_lol(
+ ['html',
+ ['head',
+ ['title','Page title'],
+ ],
+ ['body',
+ ['p','Page para',{class=>'para',id=>'p1'}],
+ ],
+ ],
+);
+ok($tree->same_as($expected_tree),
'HTML tree'
);
diff --git a/t/04-xml.t b/t/04-xml.t
index 3512469..bd4ada3 100644
--- a/t/04-xml.t
+++ b/t/04-xml.t
@@ -36,8 +36,8 @@ sub make_tree {
{
my $tree=make_tree();
-is($tree->serialize(0),
- qq{<?xml version="1.0"?>\n<stuff><test:elem1 xmlns:test="http://test/" test:buh="testing" id="1"><test:sub1>some content</test:sub1></test:elem1><elem2 id="2"/></stuff>\n},
+is($tree->toStringC14N(0),
+ qq{<stuff><test:elem1 xmlns:test="http://test/" id="1" test:buh="testing"><test:sub1>some content</test:sub1></test:elem1><elem2 id="2"></elem2></stuff>},
'XML document without default NS'
);
}
@@ -47,8 +47,8 @@ xmlns ':default' => 'ftp://test/';
{
my $tree=make_tree();
-is($tree->serialize(0),
- qq{<?xml version="1.0"?>\n<stuff xmlns="ftp://test/"><test:elem1 xmlns:test="http://test/" test:buh="testing" id="1"><test:sub1>some content</test:sub1></test:elem1><elem2 id="2"/></stuff>\n},
+is($tree->toStringC14N(0),
+ qq{<stuff xmlns="ftp://test/"><test:elem1 xmlns:test="http://test/" id="1" test:buh="testing"><test:sub1>some content</test:sub1></test:elem1><elem2 id="2"></elem2></stuff>},
'XML document with default NS'
);
}
diff --git a/t/05-mixed.t b/t/05-mixed.t
index 1546c89..e7e66b1 100644
--- a/t/05-mixed.t
+++ b/t/05-mixed.t
@@ -31,8 +31,8 @@ my $xmltree= xtree {
};
};
-is($xmltree->serialize(0),
- qq{<?xml version="1.0"?>\n<stuff><test:elem1 xmlns:test="http://test/" test:buh="testing" id="1"><test:sub1/></test:elem1><elem2 id="2"/></stuff>\n},
+is($xmltree->toStringC14N(0),
+ qq{<stuff><test:elem1 xmlns:test="http://test/" id="1" test:buh="testing"><test:sub1></test:sub1></test:elem1><elem2 id="2"></elem2></stuff>},
'XML document'
);