From f9fce9e34a1750038eee3a858cfec018d8cdf6e5 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Wed, 25 Mar 2009 15:33:22 +0100 Subject: initial stab at tree-building --- t/01-basic.t | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 t/01-basic.t (limited to 't/01-basic.t') diff --git a/t/01-basic.t b/t/01-basic.t new file mode 100644 index 0000000..a063a2f --- /dev/null +++ b/t/01-basic.t @@ -0,0 +1,25 @@ +#!perl +use Test::Most 'no_plan','die'; +use strict; +use warnings; +use Tree::Template::Declare; +use Data::Dumper; + +my $tree=tree { + node { + name 'root'; + attribs name => 'none'; + node { + name 'coso1'; + attribs name => 'coso_1'; + }; + node { + name 'coso2'; + }; + }; +}; + +diag $_ for @{$tree->draw_ascii_tree()}; +is_deeply($tree->tree_to_lol(), + [['coso1'],['coso2'],'root'], + 'built the tree'); -- cgit v1.2.3