Skip to content

Commit

Permalink
Tests for ImplicitReturnRule regarding switch statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Iikeli committed Jul 11, 2024
1 parent f1f4813 commit 18e879a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Tests/SwiftLintFrameworkTests/ImplicitReturnRuleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ final class ImplicitReturnRuleTests: SwiftLintTestCase {
)
}

func testOnlySwitchKindIncluded() {
var nonTriggeringExamples = ImplicitReturnRuleExamples.nonTriggeringExamples +
ImplicitReturnRuleExamples.triggeringExamples
nonTriggeringExamples.removeAll(
where: ImplicitReturnRuleExamples.SwitchExamples.triggeringExamples.contains
)

verifySubset(
nonTriggeringExamples: nonTriggeringExamples,
triggeringExamples: ImplicitReturnRuleExamples.SwitchExamples.triggeringExamples,
corrections: ImplicitReturnRuleExamples.SwitchExamples.corrections,
kind: .switch
)
}

private func verifySubset(
nonTriggeringExamples: [Example],
triggeringExamples: [Example],
Expand Down

0 comments on commit 18e879a

Please sign in to comment.