1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-14 22:15:54 +02:00

Add test case for invalid non digit cc number (#1182)

Adding this test case to handle case where we have non-numeric cc number
along with a valid cc number. This is discovered when we filter with
is_numeric() instead of !is_whitespace() all test case does pass. To
handle such scenario adding this test case.
This commit is contained in:
Varun Somani 2023-09-07 01:30:18 -07:00 committed by GitHub
parent 09d1265cbb
commit 3813d0b6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,7 @@ fn main() {
#[test]
fn test_non_digit_cc_number() {
assert!(!luhn("foo"));
assert!(!luhn("foo 0 0"));
}
#[test]