Files
SwiftLint/Tests/SwiftLintFrameworkTests/ParserDiagnosticsTests.swift
JP Simard 6d2e8cfc06 Skip correcting files with parser diagnostics (#3349)
* Skip correcting files with parser diagnostics

Also fix many rule examples with parser diagnostics.

* Sourcery

* Link to issue in changelog entry
2020-09-17 18:14:00 -04:00

15 lines
478 B
Swift

@testable import SwiftLintFramework
import XCTest
final class ParserDiagnosticsTests: XCTestCase {
func testFileWithParserDiagnostics() {
parserDiagnosticsDisabledForTests = false
XCTAssertNotNil(SwiftLintFile(contents: "importz Foundation").parserDiagnostics)
}
func testFileWithoutParserDiagnostics() {
parserDiagnosticsDisabledForTests = false
XCTAssertNil(SwiftLintFile(contents: "import Foundation").parserDiagnostics)
}
}