mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 14:02:22 -05:00
feat(iterators4): add factorial of zero test
This commit is contained in:
parent
3c63ef0668
commit
251d0dda34
1 changed files with 5 additions and 0 deletions
|
@ -18,6 +18,11 @@ pub fn factorial(num: u64) -> u64 {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn factorial_of_0() {
|
||||||
|
assert_eq!(1, factorial(0));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn factorial_of_1() {
|
fn factorial_of_1() {
|
||||||
assert_eq!(1, factorial(1));
|
assert_eq!(1, factorial(1));
|
||||||
|
|
Loading…
Reference in a new issue