Skip to content

Commit 7afad57

Browse files
test: Remove force_unwrap for SessionTests (#5021)
1 parent 67bbc9e commit 7afad57

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Tests/SentryTests/SentrySessionTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ class SentrySessionTestsSwift: XCTestCase {
106106
XCTAssertNil(SentrySession(jsonObject: serialized))
107107
}
108108

109-
func testSerialize_Bools() {
109+
func testSerialize_Bools() throws {
110110
let session = SentrySession(releaseName: "", distinctId: "some-id")
111111

112112
var json = session.serialize()
113113
json["init"] = 2
114114

115-
let session2 = SentrySession(jsonObject: json)
115+
let session2 = try XCTUnwrap(SentrySession(jsonObject: json))
116116

117-
let result = session2!.serialize()
117+
let result = session2.serialize()
118118

119119
XCTAssertTrue(result["init"] as? Bool ?? false)
120120
XCTAssertNotEqual(2, result["init"] as? NSNumber ?? 2)

0 commit comments

Comments
 (0)