@@ -13,7 +13,7 @@ struct DownloadTests {
13
13
let fileURL = URL ( string: " http://example.com/test1.txt " ) !
14
14
Mock ( url: fileURL, contentType: . html, statusCode: 200 , data: [ . get: testData] ) . register ( )
15
15
16
- try await download ( src: fileURL, dest: destinationURL)
16
+ try await download ( src: fileURL, dest: destinationURL, urlSession : URLSession . shared )
17
17
18
18
try #require( FileManager . default. fileExists ( atPath: destinationURL. path) )
19
19
defer { try ? FileManager . default. removeItem ( at: destinationURL) }
@@ -32,7 +32,7 @@ struct DownloadTests {
32
32
33
33
Mock ( url: fileURL, contentType: . html, statusCode: 200 , data: [ . get: testData] ) . register ( )
34
34
35
- try await download ( src: fileURL, dest: destinationURL)
35
+ try await download ( src: fileURL, dest: destinationURL, urlSession : URLSession . shared )
36
36
try #require( FileManager . default. fileExists ( atPath: destinationURL. path) )
37
37
let downloadedData = try Data ( contentsOf: destinationURL)
38
38
#expect( downloadedData == testData)
@@ -44,7 +44,7 @@ struct DownloadTests {
44
44
}
45
45
mock. register ( )
46
46
47
- try await download ( src: fileURL, dest: destinationURL)
47
+ try await download ( src: fileURL, dest: destinationURL, urlSession : URLSession . shared )
48
48
let unchangedData = try Data ( contentsOf: destinationURL)
49
49
#expect( unchangedData == testData)
50
50
#expect( etagIncluded)
@@ -61,7 +61,7 @@ struct DownloadTests {
61
61
62
62
Mock ( url: fileURL, contentType: . html, statusCode: 200 , data: [ . get: ogData] ) . register ( )
63
63
64
- try await download ( src: fileURL, dest: destinationURL)
64
+ try await download ( src: fileURL, dest: destinationURL, urlSession : URLSession . shared )
65
65
try #require( FileManager . default. fileExists ( atPath: destinationURL. path) )
66
66
var downloadedData = try Data ( contentsOf: destinationURL)
67
67
#expect( downloadedData == ogData)
@@ -73,7 +73,7 @@ struct DownloadTests {
73
73
}
74
74
mock. register ( )
75
75
76
- try await download ( src: fileURL, dest: destinationURL)
76
+ try await download ( src: fileURL, dest: destinationURL, urlSession : URLSession . shared )
77
77
downloadedData = try Data ( contentsOf: destinationURL)
78
78
#expect( downloadedData == newData)
79
79
#expect( etagIncluded)
0 commit comments