Skip to content

Commit

Permalink
RUMM-1000 Revert tests added for workarounds in #147
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Costanza committed Feb 9, 2021
1 parent d829781 commit f6b5cbf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
3 changes: 3 additions & 0 deletions Sources/Datadog/Core/Utils/JSONEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ extension JSONEncoder {
let formatted = iso8601DateFormatter.string(from: date)
try container.encode(formatted)
}
if #available(iOS 13.0, OSX 10.15, *) {
encoder.outputFormatting = [.withoutEscapingSlashes]
}
return encoder
}
}
27 changes: 0 additions & 27 deletions Tests/DatadogTests/Datadog/Core/Utils/JSONEncoderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,4 @@ class JSONEncoderTests: XCTestCase {
XCTAssertEqual(encodedURL.utf8String, #"{"value":"https:\/\/example.com\/foo"}"#)
}
}

func testWhenEncoding_thenKeysFollowLexicographicOrder() throws {
struct Foo: Codable {
var one = 1
var two = 1
var three = 1
var four = 1
var five = 1

enum CodingKeys: String, CodingKey {
case one = "aaaaaa"
case two = "bb"
case three = "aaa"
case four = "bbb"
case five = "aaa.aaa"
}
}

// When
let encodedFoo = try jsonEncoder.encode(Foo())

// Then
XCTAssertEqual(
encodedFoo.utf8String,
#"{"aaa":1,"aaa.aaa":1,"aaaaaa":1,"bb":1,"bbb":1}"#
)
}
}
2 changes: 1 addition & 1 deletion Tests/DatadogTests/Datadog/TracerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ class TracerTests: XCTestCase {
)
XCTAssertEqual(
try spanMatcher.meta.custom(keyPath: "meta.person"),
#"{"age":30,"name":"Adam","nationality":"Polish"}"#
#"{"name":"Adam","age":30,"nationality":"Polish"}"#
)
XCTAssertEqual(try spanMatcher.meta.custom(keyPath: "meta.nested.string"), "hello")
XCTAssertEqual(try spanMatcher.meta.custom(keyPath: "meta.url"), "https://example.com/image.png")
Expand Down

0 comments on commit f6b5cbf

Please sign in to comment.