From c212d75031ee8b5c87551b7f025e6224d1e7fd6e Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 19 Oct 2005 10:18:44 +0000 Subject: aggiornamento delle relazioni tra collezioni, e relazioni circolari git-svn-id: svn://luxion/repos/WebCoso/trunk@7 fcb26f47-9200-0410-b104-b98ab5b095f3 --- t/01-config.t | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 't') 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'); +} -- cgit v1.2.3