Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 58ecff7

Browse files
committed
Add two crashing test cases for PTKCardNumber's isPartiallyValid.
1 parent a5e0b16 commit 58ecff7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

PaymentKit Example/PaymentKit Test/PTKCardNumberTest.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ - (void)testCardType
2828

2929
XCTAssertEqual([CNUMBER(@"6001270990139424") cardType], PTKCardTypeUnknown, @"Detects Discover");
3030
XCTAssertEqual([CNUMBER(@"6229260990139424") cardType], PTKCardTypeUnknown, @"Detects Discover");
31+
32+
// These test two code paths that would previously crash
33+
XCTAssertEqual([CNUMBER(@"622") cardType], PTKCardTypeUnknown, @"Detects Discover");
34+
XCTAssertEqual([CNUMBER(@"624") cardType], PTKCardTypeUnknown, @"Detects Discover");
3135
}
3236

3337
- (void)testLast4

0 commit comments

Comments
 (0)