diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift index 1084a7e2d99..5656ce3b33b 100644 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -116,7 +116,8 @@ extension CommandTests { extension CompilerProtocolInitRuleTests { static var allTests: [(String, (CompilerProtocolInitRuleTests) -> () throws -> Void)] = [ - ("testWithDefaultConfiguration", testWithDefaultConfiguration) + ("testWithDefaultConfiguration", testWithDefaultConfiguration), + ("testViolationMessageForExpressibleByIntegerLiteral", testViolationMessageForExpressibleByIntegerLiteral) ] } diff --git a/Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift b/Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift index c4a6b28b5ba..8c0c84fd142 100644 --- a/Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift +++ b/Tests/SwiftLintFrameworkTests/CompilerProtocolInitRuleTests.swift @@ -2,20 +2,19 @@ import XCTest class CompilerProtocolInitRuleTests: XCTestCase { - private let ruleID = CompilerProtocolInitRule.description.identifier - - func testDefaultConfiguration() { + + func testWithDefaultConfiguration() { verifyRule(CompilerProtocolInitRule.description) } - + func testViolationMessageForExpressibleByIntegerLiteral() { guard let config = makeConfig(nil, ruleID) else { XCTFail("Failed to create configuration") return } let allViolations = violations("let a = NSNumber(integerLiteral: 1)", config: config) - + let compilerProtocolInitViolation = allViolations.first { $0.ruleDescription.identifier == ruleID } if let violation = compilerProtocolInitViolation { XCTAssertEqual(