Allow cards with no learning history when not training

This commit is contained in:
Damien Elmes 2023-09-25 15:57:35 +10:00
parent baae685dbb
commit e0399bcad2

View File

@ -153,7 +153,7 @@ pub(crate) fn single_card_revlog_to_items(
if idx > 0 {
entries.drain(..idx);
}
} else {
} else if training {
// we ignore cards that don't have any learning steps
return None;
}
@ -358,6 +358,23 @@ mod tests {
);
}
#[test]
fn bypassed_learning_is_handled() {
assert_eq!(
convert(
&[
RevlogEntry {
ease_factor: 2500,
..revlog(RevlogReviewKind::Manual, 7)
},
revlog(RevlogReviewKind::Review, 6),
],
false,
),
fsrs_items!([review(0)])
);
}
#[test]
fn single_learning_step_skipped_when_training() {
assert_eq!(