summaryrefslogtreecommitdiff
path: root/t/01-basic.t
diff options
context:
space:
mode:
authorGianni Ceccarelli <dakkar@dechirico.(none)>2009-03-25 15:33:22 +0100
committerGianni Ceccarelli <dakkar@dechirico.(none)>2009-03-25 15:33:22 +0100
commitf9fce9e34a1750038eee3a858cfec018d8cdf6e5 (patch)
tree21d1d0d1d4b51cf7ba400b5519c6be7e416d5b97 /t/01-basic.t
downloadTree-Template-Declare-f9fce9e34a1750038eee3a858cfec018d8cdf6e5.tar.gz
Tree-Template-Declare-f9fce9e34a1750038eee3a858cfec018d8cdf6e5.tar.bz2
Tree-Template-Declare-f9fce9e34a1750038eee3a858cfec018d8cdf6e5.zip
initial stab at tree-building
Diffstat (limited to 't/01-basic.t')
-rw-r--r--t/01-basic.t25
1 files changed, 25 insertions, 0 deletions
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');