mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-11 22:55:55 +05:45
## Motivation: There is no way to run code statically like in Obj-C using `+ [NSObject initialize]`, so this ensures (through a new `SwiftLint` rule) that all test classes inherit this common test class instead of `XCTestCase` directly. A future PR will make use of this new `CIRCLECI_TESTS_GENERATE_SNAPSHOTS` environment variable to allow regenerating snapshots in CI. I've also moved the duplicated `CurrentTestCaseTracker` usages to a single point.
18 lines
544 B
Swift
18 lines
544 B
Swift
import Nimble
|
|
import XCTest
|
|
|
|
@testable import RevenueCat
|
|
|
|
class ArraySliceUInt8ExtensionsTests: TestCase {
|
|
func testToUIntReturnsCorrectValue() {
|
|
var arraySlice = ArraySlice([UInt8(0b10000000), UInt8(0b10000000)])
|
|
expect(arraySlice.toUInt64()) == 0b10000000_10000000
|
|
|
|
arraySlice = ArraySlice([UInt8(0b1), UInt8(0b01), UInt8(0b10)])
|
|
expect(arraySlice.toUInt64()) == 0b00000001_00000001_00000010
|
|
|
|
arraySlice = ArraySlice([UInt8(0b10010100)])
|
|
expect(arraySlice.toUInt64()) == 0b10010100
|
|
}
|
|
}
|