Skip to content

Commit

Permalink
Fixes a crashing URL test on Linux
Browse files Browse the repository at this point in the history
Apparently, Foundation's URL#appendingPathComponent crashes cryptically on Linux
if you pass it an empty string. Isn't that fun?
  • Loading branch information
aaronsky committed May 19, 2020
1 parent 44fde33 commit 47687d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 221 deletions.
8 changes: 5 additions & 3 deletions Sources/Buildkite/Networking/APIVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public struct APIVersion {
}

func url(for path: String) -> URL {
baseURL
.appendingPathComponent(version)
.appendingPathComponent(path)
let url = baseURL.appendingPathComponent(version)
guard !path.isEmpty else {
return url
}
return url.appendingPathComponent(path)
}
}
210 changes: 0 additions & 210 deletions Tests/BuildkiteTests/XCTestManifests.swift

This file was deleted.

10 changes: 2 additions & 8 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
import XCTest

import BuildkiteTests

var tests = [XCTestCaseEntry]()
tests += BuildkiteTests.__allTests()

XCTMain(tests)
// LinuxMain.swift
fatalError("Run the tests with `swift test --enable-test-discovery`.")

0 comments on commit 47687d6

Please sign in to comment.