Skip to content

Commit

Permalink
Moved JSONSafeEncoding to v2.0 (#335)
Browse files Browse the repository at this point in the history
* Moved JSONSafeEncoding to v2.0

* Added time to iOS test until apple fixes it.

* Added stub for autoreleasepool on linux.
  • Loading branch information
bsneed authored Apr 23, 2024
1 parent 4a744ef commit a1b519e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/segmentio/jsonsafeencoding-swift.git",
"state" : {
"revision" : "13449de3474c97ca6b7a25b3288f188b7417b34a",
"version" : "1.0.2"
"revision" : "af6a8b360984085e36c6341b21ecb35c12f47ebd",
"version" : "2.0.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let package = Package(
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/segmentio/sovran-swift.git", from: "1.1.1"),
.package(url: "https://github.com/segmentio/jsonsafeencoding-swift.git", from: "1.0.2")
.package(url: "https://github.com/segmentio/jsonsafeencoding-swift.git", from: "2.0.0")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
6 changes: 5 additions & 1 deletion Sources/Segment/Utilities/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ extension DispatchQueue {
workItem.wait()
}
}

// Linux doesn't have autoreleasepool.
func autoreleasepool(closure: () -> Void) {
closure()
}
#endif

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

2 changes: 1 addition & 1 deletion Tests/Segment-Tests/Analytics_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ final class Analytics_Tests: XCTestCase {
expectation.fulfill()
}

wait(for: [expectation], timeout: 10)
wait(for: [expectation], timeout: 60)

XCTAssertNil(analytics.pendingUploads)
}
Expand Down

0 comments on commit a1b519e

Please sign in to comment.