diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2015-03-25 10:04:49 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2015-03-25 10:04:49 +0000 |
commit | 1af9ada48f844f08a4200f05a56715573a97d6e2 (patch) | |
tree | 5676f4e67b82eee1b01b80d23623f0a9df6f4c04 | |
parent | more rebust tests, work with hash randomisation (diff) | |
download | Tree-Template-Declare-1af9ada48f844f08a4200f05a56715573a97d6e2.tar.gz Tree-Template-Declare-1af9ada48f844f08a4200f05a56715573a97d6e2.tar.bz2 Tree-Template-Declare-1af9ada48f844f08a4200f05a56715573a97d6e2.zip |
make tests compatible with newer Tree::DAG_Node
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | t/01-basic.t | 6 | ||||
-rw-r--r-- | t/05-mixed.t | 6 | ||||
-rw-r--r-- | t/06-code.t | 14 | ||||
-rw-r--r-- | t/07-inherit.t | 12 |
5 files changed, 24 insertions, 20 deletions
@@ -1,5 +1,9 @@ .. -*- mode: rst; coding: utf-8 -*- - +0.6 2015-03-25 + - fixed tests that depended on a particular output from + Tree::DAG_Node::tree_to_lol(), they should now work with any + version of Tree::DAG_Node + 0.5 2013-01-27 - fixed tests broken by better hash randomisation in perl 5.18 diff --git a/t/01-basic.t b/t/01-basic.t index cb633bd..01d3510 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -19,9 +19,9 @@ my $tree=tree { }; }; -is_deeply($tree->tree_to_lol(), - [['coso1'],['coso2'],'root'], - 'built the tree'); +cmp_deeply($tree->tree_to_lol(), + [[re(qr{coso1})],[re(qr{coso2})],re(qr{root})], + 'built the tree'); is_deeply(($tree->daughters)[0]->attributes, {name => 'coso_1', other => 'some'}, 'attributes'); diff --git a/t/05-mixed.t b/t/05-mixed.t index e7e66b1..85bcf37 100644 --- a/t/05-mixed.t +++ b/t/05-mixed.t @@ -50,6 +50,6 @@ my $dagtree=dtree { }; }; -is_deeply($dagtree->tree_to_lol(), - [['coso1'],['coso2'],'root'], - 'DAG_Node tree'); +cmp_deeply($dagtree->tree_to_lol(), + [[re(qr{coso1})],[re(qr{coso2})],re(qr{root})], + 'DAG_Node tree'); diff --git a/t/06-code.t b/t/06-code.t index a37d0d3..f80c7fa 100644 --- a/t/06-code.t +++ b/t/06-code.t @@ -36,13 +36,13 @@ my $tree=tree { ); }; -is_deeply($tree->tree_to_lol(), - [ - [['description'],'item'], - [['description'],'item'], - [['description'],'item'], - 'list'], - 'tree with code'); +cmp_deeply($tree->tree_to_lol(), + [ + [[re(qr{description})],re(qr{item})], + [[re(qr{description})],re(qr{item})], + [[re(qr{description})],re(qr{item})], + re(qr{list})], + 'tree with code'); my @attrs; $tree->walk_down({callback=>sub{ diff --git a/t/07-inherit.t b/t/07-inherit.t index 2974e6f..642b24f 100644 --- a/t/07-inherit.t +++ b/t/07-inherit.t @@ -56,12 +56,12 @@ use warnings; my $base_tree=Base->doc(); -is_deeply($base_tree->tree_to_lol(), - [['title'],[['stuff'],'content'],'doc'], - 'base tree'); +cmp_deeply($base_tree->tree_to_lol(), + [[re(qr{title})],[[re(qr{stuff})],re(qr{content})],re(qr{doc})], + 'base tree'); my $deriv_tree=Derived->doc(); -is_deeply($deriv_tree->tree_to_lol(), - [['whatever'],['title'],[['something'],'content'],'doc'], - 'derived tree'); +cmp_deeply($deriv_tree->tree_to_lol(), + [[re(qr{whatever})],[re(qr{title})],[[re(qr{something})],re(qr{content})],re(qr{doc})], + 'derived tree'); |