File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ where
209209 }
210210
211211 fn edges ( & self ) -> & crate :: EdgeTable {
212+ todo ! ( "can only trigger with with Box<&thing that impl TableAccess>" ) ;
212213 T :: edges ( self )
213214 }
214215 fn sites ( & self ) -> & crate :: SiteTable {
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ impl IteratorOutput {
101101 }
102102}
103103
104+ struct TablesHolder < ' tables > {
105+ tables : & ' tables tskit:: TableCollection ,
106+ }
107+
104108fn validate_output_from_tables ( tables : tskit:: TableCollection ) {
105109 let tables_output = IteratorOutput :: new_from_tables ( & tables) ;
106110 let access_output = IteratorOutput :: new_from_table_access ( & tables) ;
@@ -149,6 +153,20 @@ fn test_traits_with_table_collection() {
149153 validate_output_from_tables ( tables)
150154}
151155
156+ #[ test]
157+ fn test_traits_with_table_collection_holder ( ) {
158+ let tables = make_tables ( ) ;
159+ let tref = & tables;
160+ let tables_output = IteratorOutput :: new_from_tables ( tref) ;
161+ let access_output = IteratorOutput :: new_from_table_access ( tref) ;
162+ assert_eq ! ( tables_output, access_output) ;
163+ let iteration_output = IteratorOutput :: new_from_table_iteration ( tref) ;
164+ assert_eq ! ( tables_output, iteration_output) ;
165+ let boxed = Box :: new ( tref) ;
166+ let dynamic_output = IteratorOutput :: new_from_dyn ( & boxed) ;
167+ assert_eq ! ( tables_output, dynamic_output) ;
168+ }
169+
152170#[ test]
153171fn test_traits_with_tree_sequence ( ) {
154172 let mut tables = make_tables ( ) ;
You can’t perform that action at this time.
0 commit comments