@@ -63,8 +63,7 @@ impl IteratorOutput {
6363 }
6464 }
6565
66- fn new_from_table_access_impl_syntax ( access : impl tskit:: TableAccess ) -> Self
67- {
66+ fn new_from_table_access_impl_syntax ( access : impl tskit:: TableAccess ) -> Self {
6867 Self :: new_from_table_access ( & access)
6968 }
7069
@@ -112,9 +111,15 @@ fn validate_output_from_tables(tables: tskit::TableCollection) {
112111 assert_eq ! ( tables_output, access_output) ;
113112 let iteration_output = IteratorOutput :: new_from_table_iteration ( & tables) ;
114113 assert_eq ! ( tables_output, iteration_output) ;
114+ let impl_syntax_output = IteratorOutput :: new_from_table_access_impl_syntax ( & tables) ;
115+ assert_eq ! ( tables_output, impl_syntax_output) ;
115116 let boxed = Box :: new ( tables) ;
116117 let dynamic_output = IteratorOutput :: new_from_dyn ( & boxed) ;
117118 assert_eq ! ( tables_output, dynamic_output) ;
119+ let impl_syntax_output = IteratorOutput :: new_from_table_access_impl_syntax ( & boxed) ;
120+ assert_eq ! ( tables_output, impl_syntax_output) ;
121+ let impl_syntax_output = IteratorOutput :: new_from_table_access_impl_syntax ( boxed) ;
122+ assert_eq ! ( tables_output, impl_syntax_output) ;
118123}
119124
120125fn validate_output_from_table_ref ( tables : tskit:: TableCollection ) {
@@ -142,6 +147,11 @@ fn validate_output_from_treeseq(treeseq: tskit::TreeSequence) {
142147 let boxed = Box :: new ( treeseq) ;
143148 let dynamic_output = IteratorOutput :: new_from_dyn ( & boxed) ;
144149 assert_eq ! ( treeseq_output, dynamic_output) ;
150+ todo ! ( "test impl syntax" )
151+ }
152+
153+ fn validate_output_from_treeseq_ref ( treeseq : tskit:: TreeSequence ) {
154+ todo ! ( )
145155}
146156
147157fn make_tables ( ) -> tskit:: TableCollection {
@@ -186,3 +196,14 @@ fn test_traits_with_tree_sequence() {
186196 let treeseq = tskit:: TreeSequence :: try_from ( tables) . unwrap ( ) ;
187197 validate_output_from_treeseq ( treeseq)
188198}
199+
200+ #[ test]
201+ fn test_traits_with_tree_sequence_ref ( ) {
202+ let mut tables = make_tables ( ) ;
203+ tables
204+ . full_sort ( tskit:: TableSortOptions :: default ( ) )
205+ . unwrap ( ) ;
206+ tables. build_index ( ) . unwrap ( ) ;
207+ let treeseq = tskit:: TreeSequence :: try_from ( tables) . unwrap ( ) ;
208+ validate_output_from_treeseq_ref ( treeseq)
209+ }
0 commit comments