mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 05:09:19 +00:00
Add factorial of zero test in standand_library_types iterators4
This commit is contained in:
parent
5002c54ffb
commit
6dcac17b01
@ -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…
x
Reference in New Issue
Block a user