Skip to content

Commit

Permalink
Fix LinterCacheTests.testDetectSwiftVersion for Swift 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
norio-nomura committed Jul 19, 2018
1 parent 41d3977 commit 093b99b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/SwiftLintFramework/Models/SwiftVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public extension SwiftVersion {
let file = File(contents: """
#if swift(>=4.2.0)
let version = "4.2.0"
#elseif swift(>=4.1.50)
let version = "4.1.50"
#elseif swift(>=4.1.2)
let version = "4.1.2"
#elseif swift(>=4.1.1)
Expand Down
2 changes: 2 additions & 0 deletions Tests/SwiftLintFrameworkTests/LinterCacheTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ class LinterCacheTests: XCTestCase {
func testDetectSwiftVersion() {
#if swift(>=4.2.0)
let version = "4.2.0"
#elseif swift(>=4.1.50)
let version = "4.2.0" // Since we can't pass SWIFT_VERSION=4 to sourcekit, it returns 4.2.0
#elseif swift(>=4.1.2)
let version = "4.1.2"
#elseif swift(>=4.1.1)
Expand Down

0 comments on commit 093b99b

Please sign in to comment.