mirror of
https://github.com/apple/swift-numerics
synced 2026-11-29 05:24:24 +00:00
[BigIntTests] Add measure {} to testFactorial()
This commit is contained in:
1 parent
98023c3575
commit
cfc2cd7c97
1 file changed
+12
-5
@@ -73,11 +73,18 @@ final class BigIntTests: XCTestCase {
|
||||
"""
|
||||
|
||||
func testFactorial() {
|
||||
let factorial512 = fac(BigInt(512))
|
||||
XCTAssertEqual(String(factorial512, radix: 36, uppercase: true),
|
||||
Self.descriptionFactorial512Radix36)
|
||||
XCTAssertEqual(BigInt(Self.descriptionFactorial512Radix36, radix: 36),
|
||||
factorial512)
|
||||
var expectedNumber: BigInt!
|
||||
var actualNumber: BigInt!
|
||||
var actualString: String!
|
||||
|
||||
measure {
|
||||
expectedNumber = BigInt(Self.descriptionFactorial512Radix36, radix: 36)
|
||||
actualNumber = fac(BigInt(512))
|
||||
actualString = String(actualNumber, radix: 36, uppercase: true)
|
||||
}
|
||||
|
||||
XCTAssertEqual(actualNumber, expectedNumber)
|
||||
XCTAssertEqual(actualString, Self.descriptionFactorial512Radix36)
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
|
||||
Reference in new issue
Block a user