Skip to content

Commit 251d0dd

Browse files
pgjbzmanyinsects
authored andcommitted
feat(iterators4): add factorial of zero test
1 parent 3c63ef0 commit 251d0dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

exercises/standard_library_types/iterators4.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ pub fn factorial(num: u64) -> u64 {
1818
mod tests {
1919
use super::*;
2020

21+
#[test]
22+
fn factorial_of_0() {
23+
assert_eq!(1, factorial(0));
24+
}
25+
2126
#[test]
2227
fn factorial_of_1() {
2328
assert_eq!(1, factorial(1));

0 commit comments

Comments
 (0)