Skip to content

Commit

Permalink
Use the appropriate type for string descriptions on Linux (#604)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunnoferreira committed Sep 20, 2024
1 parent 6d6cb71 commit 8b71cc2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/OpenTelemetryApiTests/Trace/SpanExceptionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ final class SpanExceptionTests: XCTestCase {
// `SpanException` possible since `NSError` conforms to `SpanException`.
let exception = error as SpanException

#if !os(Linux)
XCTAssertEqual(exception.type, String(reflecting: error))
#else
XCTAssertEqual(exception.type, String(reflecting: error as NSError))
#endif
XCTAssertEqual(exception.message, error.localizedDescription)
XCTAssertNil(exception.stackTrace)
}
Expand All @@ -39,7 +43,11 @@ final class SpanExceptionTests: XCTestCase {
// `SpanException` possible since `NSError` conforms to `SpanException`.
let exception = error as SpanException

#if !os(Linux)
XCTAssertEqual(exception.type, String(reflecting: error))
#else
XCTAssertEqual(exception.type, String(reflecting: error as NSError))
#endif
XCTAssertEqual(exception.message, error.localizedDescription)
XCTAssertNil(exception.stackTrace)

Expand Down

0 comments on commit 8b71cc2

Please sign in to comment.