mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
15b285527a
* Short names for test modules * Lint plugins and `Package.swift` in integration tests * Simplify and merge file groups in Bazel * Move common functions to `TestHelpers`
23 lines
762 B
Swift
23 lines
762 B
Swift
@testable import SwiftLintBuiltInRules
|
|
import TestHelpers
|
|
|
|
final class PrefixedTopLevelConstantRuleTests: SwiftLintTestCase {
|
|
func testPrivateOnly() {
|
|
let triggeringExamples = [
|
|
Example("private let ↓Foo = 20.0"),
|
|
Example("fileprivate let ↓foo = 20.0"),
|
|
]
|
|
let nonTriggeringExamples = [
|
|
Example("let Foo = 20.0"),
|
|
Example("internal let Foo = \"Foo\""),
|
|
Example("public let Foo = 20.0"),
|
|
]
|
|
|
|
let description = PrefixedTopLevelConstantRule.description
|
|
.with(triggeringExamples: triggeringExamples)
|
|
.with(nonTriggeringExamples: nonTriggeringExamples)
|
|
|
|
verifyRule(description, ruleConfiguration: ["only_private": true])
|
|
}
|
|
}
|