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
Copy file name to clipboardExpand all lines: Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTest.swift
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,24 @@ class LambdaRuntimeClientTest: XCTestCase {
191
191
}
192
192
}
193
193
194
+
func testErrorResponseToJSON(){
195
+
// we want to check if quotes and back slashes are correctly escaped
196
+
letwindowsError=ErrorResponse(
197
+
errorType:"error",
198
+
errorMessage:#"underlyingError: "An error with a windows path C:\Windows\""#
199
+
)
200
+
letwindowsBytes= windowsError.toJSONBytes()
201
+
XCTAssertEqual(#"{"errorType":"error","errorMessage":"underlyingError: \"An error with a windows path C:\\Windows\\\""}"#,String(decoding: windowsBytes, as:Unicode.UTF8.self))
0 commit comments