Skip to content

Commit

Permalink
unit test works - MultiFizzBuzz accepts a Range<i32>
Browse files Browse the repository at this point in the history
  • Loading branch information
MusicalNinjaDad committed Jun 1, 2024
1 parent 3d8e5bf commit 88d6c91
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rust/fizzbuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,17 @@ mod test {
}
assert_eq!(output, expected);
}

#[test]
fn fizzbuzz_range() {
let input = 1..20;
let iter = input.into_iter();
let mut expected: Vec<String> = vec![];
for i in 1..20 {
expected.push(i.fizzbuzz().into())
}
let output: Vec<String> = iter.fizzbuzz().into();
assert_eq!(output, expected)
}

}

0 comments on commit 88d6c91

Please sign in to comment.