Skip to content

Commit

Permalink
Fix Non-Optional String <-> Data Conversion linter violations
Browse files Browse the repository at this point in the history
  • Loading branch information
mgutski committed Jun 16, 2024
1 parent c4f83b9 commit 0c8095e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ final class Encodable_TypeErasureTests: XCTestCase {
result = try JSONEncoder().encode(anyEncodable)
)
XCTAssertEqual(1, encodableSpy.encodeCallCount)
XCTAssertEqual(#""\#(encodableValue)""#, String(data: result, encoding: .utf8))
XCTAssertEqual(#""\#(encodableValue)""#, String(decoding: result, as: UTF8.self))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class ConfigurationTests: XCTestCase {
let implementationOnlyImport = false
let secret1 = ("secret1", "value", "extend Obfuscation.Secret from ConfidentialKit", "public")
let secret2 = ("secret2", ["value1", "value2"])
let jsonConfiguration =
let jsonConfiguration = Data(
"""
{
"algorithm": [\(algorithm.map { #""\#($0)""# }.joined(separator: ","))],
Expand All @@ -23,7 +23,8 @@ final class ConfigurationTests: XCTestCase {
{ "name": "\(secret2.0)", "value": [\(secret2.1.map { #""\#($0)""# }.joined(separator: ","))] }
]
}
""".data(using: .utf8)!
""".utf8
)
let decoder = JSONDecoder()

// when & then
Expand Down

0 comments on commit 0c8095e

Please sign in to comment.