Skip to content

Commit 5bf86ae

Browse files
authored
test: rewrite table API tests (#356)
Using macros, we can drop over 1,000 lines and only lose a bit of coverage. A lot of missing coverage is from table getter functions, which are best covered via doctests.
1 parent e2edf56 commit 5bf86ae

File tree

5 files changed

+388
-1101
lines changed

5 files changed

+388
-1101
lines changed

src/provenance.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,12 @@ impl OwnedProvenanceTable {
192192
#[cfg(test)]
193193
mod test_provenances {
194194
use super::*;
195-
use crate::test_fixtures::make_empty_table_collection;
196195
use crate::TableAccess;
197196

198197
#[test]
199198
fn test_empty_record_string() {
200199
// check for tables...
201-
let mut tables = make_empty_table_collection(1.0);
200+
let mut tables = crate::TableCollection::new(10.).unwrap();
202201
let s = String::from("");
203202
let row_id = tables.add_provenance(&s).unwrap();
204203
let _ = tables.provenances().row(row_id).unwrap();
@@ -215,7 +214,7 @@ mod test_provenances {
215214
#[test]
216215
fn test_add_rows() {
217216
let records = vec!["banana".to_string(), "split".to_string()];
218-
let mut tables = make_empty_table_collection(1.);
217+
let mut tables = crate::TableCollection::new(10.).unwrap();
219218
for (i, r) in records.iter().enumerate() {
220219
let row_id = tables.add_provenance(r).unwrap();
221220
assert!(row_id == ProvenanceId(i as crate::tsk_id_t));

0 commit comments

Comments
 (0)