Skip to content

Commit

Permalink
Add overflow test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalvany committed Apr 15, 2024
1 parent cb1f4e3 commit ed7b488
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/double_metaphone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3443,11 +3443,20 @@ mod tests {
}

#[test]
fn test_overflow_contains() {
fn test_overflow_contains_case_1() {
let encoder = DoubleMetaphone::default();

let result = encoder.encode_alternate("LLANA");

assert_eq!(result, "LN");
}

#[test]
fn test_overflow_contains_case_2() {
let encoder = DoubleMetaphone::default();

let result = encoder.encode_alternate("CCILE");

assert_eq!(result, "XL");
}
}

0 comments on commit ed7b488

Please sign in to comment.