Skip to content

Commit

Permalink
Fixed code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zuziaka committed Nov 2, 2020
1 parent 32225a1 commit 8e82e0d
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test_runner/src/main/kotlin/ftl/ios/xctest/FindTestNames.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ internal fun findTestNames(xctestrun: File): XctestrunMethods =
}

internal fun findTestsForTestTarget(testTarget: String, xctestrun: File): List<String> =
parseToNSDictionary(xctestrun).get(testTarget)
?.let { (it as? NSDictionary) }
?.let { it.findTestsForTarget(testTarget, testRoot = xctestrun.parent + "/") }
?: throw FlankGeneralError("Test target $testTarget doesn't exist")
parseToNSDictionary(xctestrun).get(testTarget)
?.let { (it as? NSDictionary) }
?.let { it.findTestsForTarget(testTarget, testRoot = xctestrun.parent + "/") }
?: throw FlankGeneralError("Test target $testTarget doesn't exist")

private fun NSDictionary.findTestsForTarget(testTarget: String, testRoot: String): List<String> =
if (testTarget.isMetadata()) emptyList()
Expand All @@ -35,10 +35,10 @@ private fun NSDictionary.findTestsForTarget(testTarget: String, testRoot: String
?: throw FlankGeneralError("No tests found")

private fun NSDictionary.findXcTestTargets(testTarget: String): NSObject? =
get("DependentProductPaths")
?.let { it as? NSArray }?.array
?.first { product -> product.toString().containsTestTarget(testTarget) }
?: throw FlankGeneralError("Test target $testTarget doesn't exist")
get("DependentProductPaths")
?.let { it as? NSArray }?.array
?.first { product -> product.toString().containsTestTarget(testTarget) }
?: throw FlankGeneralError("Test target $testTarget doesn't exist")

private fun String.containsTestTarget(name: String): Boolean = contains("/$name.xctest")

Expand Down

0 comments on commit 8e82e0d

Please sign in to comment.