Members walk test: 599 members, so a page of 199 takes 4 pages and fails
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
eadc2bfadc
commit
05347b5417
1 changed files with 5 additions and 5 deletions
|
|
@ -1910,21 +1910,21 @@ mod tests {
|
|||
/// The walk costs one select per LIMIT_MAX members whatever the caller
|
||||
/// asked for, through the production `members`: a caller's `limit`,
|
||||
/// projection or spread never reach it. At limit 1 and document
|
||||
/// projection over 590 questions the walk takes exactly 3 pages and
|
||||
/// projection over 599 questions the walk takes exactly 3 pages and
|
||||
/// returns exactly the questions, in key order.
|
||||
#[test]
|
||||
fn the_members_walk_takes_its_page_size_from_the_mind_not_the_caller() {
|
||||
let mut mind = seeded();
|
||||
for start in (0..590u32).step_by(crate::admission::BATCH_MAX) {
|
||||
committed(admit(&mut mind, (start..(start + crate::admission::BATCH_MAX as u32).min(590)).map(question_n).collect()));
|
||||
for start in (0..599u32).step_by(crate::admission::BATCH_MAX) {
|
||||
committed(admit(&mut mind, (start..(start + crate::admission::BATCH_MAX as u32).min(599)).map(question_n).collect()));
|
||||
}
|
||||
let caller = Selection { limit: Some(1), projection: PROJECTION_DOCUMENT.into(), ..of_kinds(&[K::Question]) };
|
||||
let members = mind.members(&caller, &asking(5)).unwrap();
|
||||
let mut expected: Vec<PipelineRef> = (0..590).map(|n| r(K::Question, &id("question", &format!("Q{n}")))).collect();
|
||||
let mut expected: Vec<PipelineRef> = (0..599).map(|n| r(K::Question, &id("question", &format!("Q{n}")))).collect();
|
||||
expected.sort_by(|a, b| a.id.0.cmp(&b.id.0));
|
||||
assert_eq!(members.ids, expected, "exactly the questions, once each, in key order");
|
||||
assert_eq!(LIMIT_MAX, 200);
|
||||
assert_eq!(members.pages, 3, "590 members at the mind's page of 200");
|
||||
assert_eq!(members.pages, 3, "599 members at the mind's page of 200");
|
||||
}
|
||||
|
||||
/// The walk keeps the caller's `cites` hop: among follow-ups, only the one
|
||||
|
|
|
|||
Loading…
Reference in a new issue