From 51f4aa20bed06bced8d0c75df247e5c9ef8ebbb3 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Mon, 28 Nov 2016 23:09:55 -0800 Subject: [PATCH] add tests for reporterFromString(_:) --- Tests/SwiftLintFramework/ReporterTests.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/SwiftLintFramework/ReporterTests.swift b/Tests/SwiftLintFramework/ReporterTests.swift index ac69a78cb..737a6dd90 100644 --- a/Tests/SwiftLintFramework/ReporterTests.swift +++ b/Tests/SwiftLintFramework/ReporterTests.swift @@ -11,6 +11,20 @@ import XCTest class ReporterTests: XCTestCase { + func testReporterFromString() { + let reporters: [Reporter.Type] = [ + XcodeReporter.self, + JSONReporter.self, + CSVReporter.self, + CheckstyleReporter.self, + JUnitReporter.self, + HTMLReporter.self + ] + for reporter in reporters { + XCTAssertEqual(reporter.identifier, reporterFromString(reporter.identifier).identifier) + } + } + func generateViolations() -> [StyleViolation] { let location = Location(file: "filename", line: 1, character: 2) return [