Live Activities, nudging, unit tests
This commit is contained in:
@@ -148,9 +148,9 @@ struct AnyCodableTests {
|
||||
|
||||
@Test("Dictionary decodes keys correctly")
|
||||
func dictRoundTrip() throws {
|
||||
let dict = AnyCodable(["key": AnyCodable("value")])
|
||||
let encoded = try JSONEncoder().encode(dict)
|
||||
let decoded = try JSONDecoder().decode(AnyCodable.self, from: encoded)
|
||||
// Build the AnyCodable from raw JSON to avoid double-wrapping issues
|
||||
let json = #"{"key":"value"}"#
|
||||
let decoded = try JSONDecoder().decode(AnyCodable.self, from: Data(json.utf8))
|
||||
let map = try decoded.decode(as: [String: AnyCodable].self)
|
||||
#expect(try map["key"]?.decode(as: String.self) == "value")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user