Skip to content

Commit 29413e7

Browse files
committed
one down
1 parent f6f5bab commit 29413e7

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

tests/test_table_traits.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

120125
fn 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

147157
fn 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

Comments
 (0)