Skip to content

Commit d514ad1

Browse files
committed
add test
1 parent 7e7651e commit d514ad1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tests/ParseSwiftTests/ParseFileTests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,20 @@ class ParseFileTests: XCTestCase { // swiftlint:disable:this type_body_length
207207
"{\"__type\":\"File\",\"name\":\"sampleData.txt\"}")
208208
}
209209

210+
func testDebugStringWithFolderInName() throws {
211+
guard let sampleData = "Hello World".data(using: .utf8) else {
212+
throw ParseError(code: .unknownError, message: "Should have converted to data")
213+
}
214+
let parseFile = ParseFile(name: "myFolder/sampleData.txt",
215+
data: sampleData,
216+
metadata: ["Testing": "123"],
217+
tags: ["Hey": "now"])
218+
XCTAssertEqual(parseFile.debugDescription,
219+
"{\"__type\":\"File\",\"name\":\"myFolder\\/sampleData.txt\"}")
220+
XCTAssertEqual(parseFile.description,
221+
"{\"__type\":\"File\",\"name\":\"myFolder\\/sampleData.txt\"}")
222+
}
223+
210224
func testSave() throws {
211225
guard let sampleData = "Hello World".data(using: .utf8) else {
212226
throw ParseError(code: .unknownError, message: "Should have converted to data")

0 commit comments

Comments
 (0)