aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/01-config.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/01-config.t b/t/01-config.t
index 4393eef..78000a3 100644
--- a/t/01-config.t
+++ b/t/01-config.t
@@ -163,3 +163,36 @@ is_deeply(
'c1 figlio di c2');
}
+
+WebCoso::Config->clear();
+
+{
+my $conf_file=<<'EOF';
+$c1=coll({it=>'coll1',en=>'coll1-en'});
+$c2=coll('coll2',[],[$c1]);
+$c1->add_child($c2);
+EOF
+
+ok(WebCoso::Config->read_scalar($conf_file,"$thisdir/config-in-test"),
+ 'eseguita la configurazione (no strict)');
+
+my @collections=WebCoso::Config->get_all_collections();
+is(scalar @collections,2,'due collezioni');
+
+is_deeply(
+ [$collections[1]->get_children()],
+ [$collections[0]],
+ 'c1 figlio di c2');
+is_deeply(
+ [$collections[0]->get_parents()],
+ [$collections[1]],
+ 'c2 padre di c1');
+ is_deeply(
+ [$collections[0]->get_children()],
+ [$collections[1]],
+ 'c2 figlio di c1');
+is_deeply(
+ [$collections[1]->get_parents()],
+ [$collections[0]],
+ 'c1 padre di c2');
+}