mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
Finishes [CSDK-17]. Follow up to #2153. Extracted from #2096. ### Changes: - Created target in `Package.swift`. It can be built separately: `swift build --target ReceiptParser`  - Created `ReceiptParser` target in project:  - Added `ReceiptParser` scheme to allow building the target from Xcode:  - Added CI `spm-receipt-parser` job - Added CI `installation-tests-receipt-parser` job - Added `ReceiptParserAPITester` to test API for `ReceiptParser`'s target - Compile `ReceiptParserAPITester` when running `RevenueCat` tests so these are validated as well. - [CSDK-17]: https://revenuecats.atlassian.net/browse/CSDK-17?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
26 lines
606 B
Swift
26 lines
606 B
Swift
//
|
|
// ReceiptParserIntegrationTests.swift
|
|
// ReceiptParserIntegrationTests
|
|
//
|
|
// Created by Nacho Soto on 11/29/22.
|
|
//
|
|
|
|
import ReceiptParser
|
|
import ReceiptParserIntegration
|
|
import XCTest
|
|
|
|
final class ReceiptParserIntegrationTests: XCTestCase {
|
|
|
|
func testParsingEmptyReceiptThrowsError() throws {
|
|
do {
|
|
_ = try PurchasesReceiptParser.default.parse(from: Data())
|
|
XCTFail("Expected error")
|
|
} catch PurchasesReceiptParser.Error.asn1ParsingError {
|
|
// Expected error
|
|
} catch {
|
|
XCTFail("Unexpected error: \(error)")
|
|
}
|
|
}
|
|
|
|
}
|