Skip to content

Commit

Permalink
Add test get_child_document_ids test case for document with empty rel…
Browse files Browse the repository at this point in the history
…ation list
  • Loading branch information
sandreae committed Jun 5, 2024
1 parent 086d424 commit c00c4c7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions aquadoggo/src/db/stores/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,4 +1431,27 @@ mod tests {
assert_eq!(next_args, (None, None, SeqNum::default(), LogId::new(1)));
});
}

#[rstest]
fn regression_handle_null_relation_list_value(
#[from(populate_store_config)]
#[with(1, 1, vec![KeyPair::new()])]
config: PopulateStoreConfig,
) {
test_runner(|mut node: TestNode| async move {
// Populate the store and materialize all documents.
let documents = populate_and_materialize(&mut node, &config).await;
let document = documents[0].clone();

// The default test document contains an empty pinned relation field so we expect this
// query to error.
let result = node
.context
.store
.get_child_document_ids(&document.view_id())
.await;

assert!(result.is_ok());
});
}
}

0 comments on commit c00c4c7

Please sign in to comment.