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`
21 lines
813 B
Swift
21 lines
813 B
Swift
@testable import SwiftLintBuiltInRules
|
|
import TestHelpers
|
|
import XCTest
|
|
|
|
final class TypesafeArrayInitRuleTests: SwiftLintTestCase {
|
|
func testViolationRuleIdentifier() {
|
|
let baseDescription = TypesafeArrayInitRule.description
|
|
guard let triggeringExample = baseDescription.triggeringExamples.first else {
|
|
XCTFail("No triggering examples found")
|
|
return
|
|
}
|
|
guard let config = makeConfig(nil, baseDescription.identifier) else {
|
|
XCTFail("Failed to create configuration")
|
|
return
|
|
}
|
|
let violations = violations(triggeringExample, config: config, requiresFileOnDisk: true)
|
|
XCTAssertGreaterThanOrEqual(violations.count, 1)
|
|
XCTAssertEqual(violations.first?.ruleIdentifier, baseDescription.identifier)
|
|
}
|
|
}
|