mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
steal other pr's test
This commit is contained in:
parent
ea29078ac2
commit
02f31791ac
1 changed files with 18 additions and 0 deletions
|
@ -31,3 +31,21 @@ impl Collection {
|
||||||
Ok(studied_today(today.cards, today.seconds as f32, &self.tr))
|
Ok(studied_today(today.cards, today.seconds as f32, &self.tr))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use anki_i18n::I18n;
|
||||||
|
use super::studied_today;
|
||||||
|
#[test]
|
||||||
|
fn today() {
|
||||||
|
let tr = I18n::template_only();
|
||||||
|
assert_eq!(
|
||||||
|
&studied_today(3, 13.0, &tr).replace('\n', " "),
|
||||||
|
"Studied 3 cards in 13 seconds today (4.33s/card)"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
&studied_today(300, 5400.0, &tr).replace('\n', " "),
|
||||||
|
"Studied 300 cards in 90 minutes today (18s/card)"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue