From 77bad686f7b8780e94fea6f999b0001bf880985f Mon Sep 17 00:00:00 2001 From: Vincent Esche Date: Wed, 2 Jan 2019 14:59:55 +0100 Subject: [PATCH] Improve `XMLStackParserTests` to test against CDATA blocks --- .../Auxiliary/XMLStackParserTests.swift | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Tests/XMLCoderTests/Auxiliary/XMLStackParserTests.swift b/Tests/XMLCoderTests/Auxiliary/XMLStackParserTests.swift index aa1d5937..82b697d0 100644 --- a/Tests/XMLCoderTests/Auxiliary/XMLStackParserTests.swift +++ b/Tests/XMLCoderTests/Auxiliary/XMLStackParserTests.swift @@ -12,7 +12,13 @@ class XMLStackParserTests: XCTestCase { func testParseWith() throws { let parser = _XMLStackParser() - let xmlString = "42" + let xmlString = + """ + + 42 + + + """ let xmlData = xmlString.data(using: .utf8)! let root: _XMLElement? = try parser.parse(with: xmlData, @@ -27,6 +33,12 @@ class XMLStackParserTests: XCTestCase { value: "42" ), ], + "data": [ + _XMLElement( + key: "data", + value: "lorem ipsum" + ), + ], ] ) XCTAssertEqual(root, expected)