You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A developer may rely on this formatting option to make a test deterministic. However, because the behavior differs across platforms, the test is not portable.
Test Case
import Foundation
letdictionary=["a":"a","B":"b"]letjsonEncoder=JSONEncoder()
jsonEncoder.outputFormatting =[.sortedKeys]letjsonBytes=try! jsonEncoder.encode(dictionary)letjsonString=String(decoding: jsonBytes, as:UTF8.self)print(jsonString)