Allow cards with no learning history when not training
This commit is contained in:
parent
baae685dbb
commit
e0399bcad2
@ -153,7 +153,7 @@ pub(crate) fn single_card_revlog_to_items(
|
|||||||
if idx > 0 {
|
if idx > 0 {
|
||||||
entries.drain(..idx);
|
entries.drain(..idx);
|
||||||
}
|
}
|
||||||
} else {
|
} else if training {
|
||||||
// we ignore cards that don't have any learning steps
|
// we ignore cards that don't have any learning steps
|
||||||
return None;
|
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]
|
#[test]
|
||||||
fn single_learning_step_skipped_when_training() {
|
fn single_learning_step_skipped_when_training() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
Loading…
Reference in New Issue
Block a user