From: <mjd...@us...> - 2009-11-24 03:59:32
|
Revision: 305 http://treebase.svn.sourceforge.net/treebase/?rev=305&view=rev Author: mjdominus Date: 2009-11-24 03:59:19 +0000 (Tue, 24 Nov 2009) Log Message: ----------- test subobject chaining Modified Paths: -------------- trunk/treebase-core/src/main/perl/t/21_subobject.t Modified: trunk/treebase-core/src/main/perl/t/21_subobject.t =================================================================== --- trunk/treebase-core/src/main/perl/t/21_subobject.t 2009-11-24 03:56:01 UTC (rev 304) +++ trunk/treebase-core/src/main/perl/t/21_subobject.t 2009-11-24 03:59:19 UTC (rev 305) @@ -1,4 +1,4 @@ -use Test::More tests => 4; +use Test::More tests => 11; use_ok('CIPRES::TreeBase::TestObjects'); use DBI; @@ -10,3 +10,11 @@ # root_node's class is defined by %Tree::subobject, not by the default behavior is(Tree->new(24)->root_node->id, Tree->new(24)->root_node_id); + +# trace attributes through subobject and back again: make a tree +# object, get is root_node object, then come back to the tree via +# root_node:tree_id, and see if we ended in the same place +for my $tid (1,2,24,119,120,5040,40320) { + is(Tree->new($tid)->root_node->tree->id, $tid); +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |