@@ -61,13 +61,13 @@ class HTMLEntitiesTests: XCTestCase {
6161
6262 do {
6363 _ = try escaped. htmlUnescape ( strict: true )
64- XCTAssert ( false )
64+ XCTFail ( " Did not throw error " )
6565 }
6666 catch ParseError . MissingSemicolon {
6767 XCTAssert ( true )
6868 }
6969 catch {
70- XCTAssert ( false )
70+ XCTFail ( " Wrong error thrown " )
7171 }
7272 }
7373
@@ -99,13 +99,13 @@ class HTMLEntitiesTests: XCTestCase {
9999
100100 do {
101101 _ = try decEscaped. htmlUnescape ( strict: true )
102- XCTAssert ( false )
102+ XCTFail ( " Did not throw error " )
103103 }
104104 catch ParseError . DeprecatedNumericReference {
105105 XCTAssert ( true )
106106 }
107107 catch {
108- XCTAssert ( false )
108+ XCTFail ( " Wrong error thrown " )
109109 }
110110
111111 do {
@@ -116,7 +116,7 @@ class HTMLEntitiesTests: XCTestCase {
116116 XCTAssert ( true )
117117 }
118118 catch {
119- XCTAssert ( false )
119+ XCTFail ( " Wrong error thrown " )
120120 }
121121 }
122122
@@ -135,23 +135,24 @@ class HTMLEntitiesTests: XCTestCase {
135135
136136 do {
137137 _ = try decEscaped. htmlUnescape ( strict: true )
138- XCTAssert ( false )
138+ XCTFail ( " Did not throw error " )
139139 }
140140 catch ParseError . OutsideValidUnicodeRange {
141141 XCTAssert ( true )
142142 }
143143 catch {
144- XCTAssert ( false )
144+ XCTFail ( " Wrong error thrown " )
145145 }
146146
147147 do {
148148 _ = try hexEscaped. htmlUnescape ( strict: true )
149+ XCTFail ( " Did not throw error " )
149150 }
150151 catch ParseError . OutsideValidUnicodeRange {
151152 XCTAssert ( true )
152153 }
153154 catch {
154- XCTAssert ( false )
155+ XCTFail ( " Wrong error thrown " )
155156 }
156157 }
157158
@@ -178,24 +179,24 @@ class HTMLEntitiesTests: XCTestCase {
178179
179180 do {
180181 _ = try decEscaped. htmlUnescape ( strict: true )
181- XCTAssert ( false )
182+ XCTFail ( " Did not throw error " )
182183 }
183184 catch ParseError . DisallowedNumericReference {
184185 XCTAssert ( true )
185186 }
186187 catch {
187- XCTAssert ( false )
188+ XCTFail ( " Wrong error thrown " )
188189 }
189190
190191 do {
191192 _ = try hexEscaped. htmlUnescape ( strict: true )
192- XCTAssert ( false )
193+ XCTFail ( " Did not throw error " )
193194 }
194195 catch ParseError . DisallowedNumericReference {
195196 XCTAssert ( true )
196197 }
197198 catch {
198- XCTAssert ( false )
199+ XCTFail ( " Wrong error thrown " )
199200 }
200201 }
201202 }
@@ -238,41 +239,41 @@ class HTMLEntitiesTests: XCTestCase {
238239
239240 do {
240241 _ = try " 한 " . htmlUnescape ( strict: true )
241- XCTAssert ( false )
242+ XCTFail ( " Did not throw error " )
242243 }
243244 catch ParseError . MissingSemicolon {
244245 XCTAssert ( true )
245246 }
246247 catch {
247- XCTAssert ( false )
248+ XCTFail ( " Wrong error thrown " )
248249 }
249250
250251 let badEntity = " &some &text; here <script> some more; text here; "
251252 XCTAssertEqual ( badEntity. htmlUnescape ( ) , " &some &text; here <script> some more; text here; " )
252253
253254 do {
254255 _ = try badEntity. htmlUnescape ( strict: true )
255- XCTAssert ( false )
256+ XCTFail ( " Did not throw error " )
256257 }
257258 catch ParseError . InvalidNamedReference {
258259 XCTAssert ( true )
259260 }
260261 catch {
261- XCTAssert ( false )
262+ XCTFail ( " Wrong error thrown " )
262263 }
263264
264265 let legacyEmbedded = " I'm ¬it; I tell you "
265266 XCTAssertEqual ( legacyEmbedded. htmlUnescape ( ) , " I'm ¬it; I tell you " )
266267
267268 do {
268269 _ = try legacyEmbedded. htmlUnescape ( strict: true )
269- XCTAssert ( false )
270+ XCTFail ( " Did not throw error " )
270271 }
271272 catch ParseError . MissingSemicolon {
272273 XCTAssert ( true )
273274 }
274275 catch {
275- XCTAssert ( false )
276+ XCTFail ( " Wrong error thrown " )
276277 }
277278
278279 XCTAssertEqual ( try " &∾̳ " . htmlUnescape ( strict: true ) , " &∾̳ " )
@@ -281,26 +282,26 @@ class HTMLEntitiesTests: XCTestCase {
281282
282283 do {
283284 _ = try " &#∾̳ " . htmlUnescape ( strict: true )
284- XCTAssert ( false )
285+ XCTFail ( " Did not throw error " )
285286 }
286287 catch ParseError . MalformedNumericReference {
287288 XCTAssert ( true )
288289 }
289290 catch {
290- XCTAssert ( false )
291+ XCTFail ( " Wrong error thrown " )
291292 }
292293
293294 XCTAssertEqual ( " {∾̳ " . htmlUnescape ( ) , " {∾̳ " )
294295
295296 do {
296297 _ = try " {∾̳ " . htmlUnescape ( strict: true )
297- XCTAssert ( false )
298+ XCTFail ( " Did not throw error " )
298299 }
299300 catch ParseError . MissingSemicolon {
300301 XCTAssert ( true )
301302 }
302303 catch {
303- XCTAssert ( false )
304+ XCTFail ( " Wrong error thrown " )
304305 }
305306
306307 XCTAssertEqual ( " ઼∾̳ " . htmlUnescape ( ) , " ઼∾̳ " )
@@ -335,13 +336,13 @@ class HTMLEntitiesTests: XCTestCase {
335336
336337 do {
337338 _ = try text. htmlUnescape ( strict: true )
338- XCTAssert ( false )
339+ XCTFail ( " Did not throw error " )
339340 }
340341 catch ParseError . MissingSemicolon {
341342 XCTAssert ( true )
342343 }
343344 catch {
344- XCTAssert ( false )
345+ XCTFail ( " Wrong error thrown " )
345346 }
346347 }
347348
0 commit comments