Skip to content

Commit

Permalink
Added digit 9 test case from the canonical test suite (#1655)
Browse files Browse the repository at this point in the history
9 is an edge case that is very important to keep testing in the advanced Luhn iteration exercises
  • Loading branch information
felix91gr committed Jul 20, 2023
1 parent ae5cc14 commit 433c48a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exercises/practice/luhn-from/tests/luhn-from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ fn invalid_credit_card_is_invalid() {
fn strings_that_contain_non_digits_are_invalid() {
assert!(!Luhn::from("046a 454 286").is_valid());
}

#[test]
#[ignore]
fn test_input_digit_9_is_still_correctly_converted_to_output_digit_9() {
assert!(Luhn::from("091").is_valid());
}
6 changes: 6 additions & 0 deletions exercises/practice/luhn-trait/tests/luhn-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ fn you_can_validate_from_a_usize() {
assert!(valid.valid_luhn());
assert!(!invalid.valid_luhn());
}

#[test]
#[ignore]
fn test_input_digit_9_is_still_correctly_converted_to_output_digit_9() {
assert!("091".valid_luhn());
}

0 comments on commit 433c48a

Please sign in to comment.