Skip to content

Commit a1b519e

Browse files
authored
Moved JSONSafeEncoding to v2.0 (#335)
* Moved JSONSafeEncoding to v2.0 * Added time to iOS test until apple fixes it. * Added stub for autoreleasepool on linux.
1 parent 4a744ef commit a1b519e

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ let package = Package(
2222
// Dependencies declare other packages that this package depends on.
2323
// .package(url: /* package url */, from: "1.0.0"),
2424
.package(url: "https://github.com/segmentio/sovran-swift.git", from: "1.1.1"),
25-
.package(url: "https://github.com/segmentio/jsonsafeencoding-swift.git", from: "1.0.2")
25+
.package(url: "https://github.com/segmentio/jsonsafeencoding-swift.git", from: "2.0.0")
2626
],
2727
targets: [
2828
// Targets are the basic building blocks of a package. A target can define a module or a test suite.

Sources/Segment/Utilities/Utils.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ extension DispatchQueue {
1616
workItem.wait()
1717
}
1818
}
19+
20+
// Linux doesn't have autoreleasepool.
21+
func autoreleasepool(closure: () -> Void) {
22+
closure()
23+
}
1924
#endif
2025

2126
/// Inquire as to whether we are within a Unit Testing environment.
@@ -84,4 +89,3 @@ internal func eventStorageDirectory(writeKey: String) -> URL {
8489
try? FileManager.default.createDirectory(at: segmentURL, withIntermediateDirectories: true, attributes: nil)
8590
return segmentURL
8691
}
87-

Tests/Segment-Tests/Analytics_Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ final class Analytics_Tests: XCTestCase {
771771
expectation.fulfill()
772772
}
773773

774-
wait(for: [expectation], timeout: 10)
774+
wait(for: [expectation], timeout: 60)
775775

776776
XCTAssertNil(analytics.pendingUploads)
777777
}

0 commit comments

Comments
 (0)