summaryrefslogtreecommitdiff
path: root/t/01-basic.t
diff options
context:
space:
mode:
Diffstat (limited to 't/01-basic.t')
-rw-r--r--t/01-basic.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/01-basic.t b/t/01-basic.t
new file mode 100644
index 0000000..01d3510
--- /dev/null
+++ b/t/01-basic.t
@@ -0,0 +1,27 @@
+#!perl
+use Test::Most tests => 2,'die';
+use strict;
+use warnings;
+use Tree::Template::Declare builder => '+DAG_Node';
+
+my $tree=tree {
+ node {
+ name 'root';
+ attribs name => 'none';
+ node {
+ name 'coso1';
+ attribs name => 'coso_1';
+ attribs other => 'some';
+ };
+ node {
+ name 'coso2';
+ };
+ };
+};
+
+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');