Skip to content

Commit 84ecba7

Browse files
committed
Make brotli test available on Linux
1 parent f0fbde1 commit 84ecba7

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Tests/Foundation/TestURLSession.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,15 @@ final class TestURLSession: LoopbackServerTest, @unchecked Sendable {
3232
}
3333

3434
func test_dataTaskWithAcceptEncoding() async {
35-
#if !os(Windows)
36-
throw XCTSkip("This test is currently only enabled on Windows")
37-
#else
3835
let urlString = "http://127.0.0.1:\(TestURLSession.serverPort)/accept-encoding"
3936
let url = URL(string: urlString)!
4037
let d = DataTask(with: expectation(description: "GET \(urlString): with a delegate"))
4138
d.run(with: url)
4239
waitForExpectations(timeout: 12)
4340
if !d.error {
44-
XCTAssertEqual(d.capital, "deflate, gzip, br", "test_dataTaskWithURLRequest returned an unexpected result")
41+
let supportedEncodings = d.capital.split(separator: ",").map { $0.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines ) }
42+
XCTAssert(supportedEncodings.contains("br"), "test_dataTaskWithURLRequest returned an unexpected result")
4543
}
46-
#endif
4744
}
4845

4946
func test_dataTaskWithURLCompletionHandler() async {
@@ -272,9 +269,6 @@ final class TestURLSession: LoopbackServerTest, @unchecked Sendable {
272269
}
273270

274271
func test_brotliDataTask() async {
275-
#if !os(Windows)
276-
throw XCTSkip("This test is currently only enabled on Windows")
277-
#else
278272
let urlString = "http://127.0.0.1:\(TestURLSession.serverPort)/brotli-response"
279273
let url = URL(string: urlString)!
280274
let d = DataTask(with: expectation(description: "GET \(urlString): brotli response"))
@@ -283,7 +277,6 @@ final class TestURLSession: LoopbackServerTest, @unchecked Sendable {
283277
if !d.error {
284278
XCTAssertEqual(d.capital, "Hello World!")
285279
}
286-
#endif
287280
}
288281

289282
func test_downloadTaskWithURL() async {

0 commit comments

Comments
 (0)