100-days-of-rust/Week-01/Day-05_Pair-Of-Socks/pair_of_socks/tests/examples_sockpairs.rs

17 lines
248 B
Rust
Raw Normal View History

2024-07-30 09:17:39 +00:00
use pair_of_socks::sock_pairs;
#[test]
fn one_sock_pair() {
assert_eq!(sock_pairs("AA"), 1);
}
#[test]
fn two_sock_pair() {
assert_eq!(sock_pairs("ABABC"), 2);
}
#[test]
fn four_sock_pair() {
assert_eq!(sock_pairs("CABBACCC"), 4);
}