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
209
209
}
210
210
211
211
fn edges ( & self ) -> & crate :: EdgeTable {
212
+ todo ! ( "can only trigger with with Box<&thing that impl TableAccess>" ) ;
212
213
T :: edges ( self )
213
214
}
214
215
fn sites ( & self ) -> & crate :: SiteTable {
Original file line number Diff line number Diff line change @@ -101,6 +101,10 @@ impl IteratorOutput {
101
101
}
102
102
}
103
103
104
+ struct TablesHolder < ' tables > {
105
+ tables : & ' tables tskit:: TableCollection ,
106
+ }
107
+
104
108
fn validate_output_from_tables ( tables : tskit:: TableCollection ) {
105
109
let tables_output = IteratorOutput :: new_from_tables ( & tables) ;
106
110
let access_output = IteratorOutput :: new_from_table_access ( & tables) ;
@@ -149,6 +153,20 @@ fn test_traits_with_table_collection() {
149
153
validate_output_from_tables ( tables)
150
154
}
151
155
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
+
152
170
#[ test]
153
171
fn test_traits_with_tree_sequence ( ) {
154
172
let mut tables = make_tables ( ) ;
You can’t perform that action at this time.
0 commit comments