@@ -61,13 +61,13 @@ class HTMLEntitiesTests: XCTestCase {
61
61
62
62
do {
63
63
_ = try escaped. htmlUnescape ( strict: true )
64
- XCTAssert ( false )
64
+ XCTFail ( " Did not throw error " )
65
65
}
66
66
catch ParseError . MissingSemicolon {
67
67
XCTAssert ( true )
68
68
}
69
69
catch {
70
- XCTAssert ( false )
70
+ XCTFail ( " Wrong error thrown " )
71
71
}
72
72
}
73
73
@@ -99,13 +99,13 @@ class HTMLEntitiesTests: XCTestCase {
99
99
100
100
do {
101
101
_ = try decEscaped. htmlUnescape ( strict: true )
102
- XCTAssert ( false )
102
+ XCTFail ( " Did not throw error " )
103
103
}
104
104
catch ParseError . DeprecatedNumericReference {
105
105
XCTAssert ( true )
106
106
}
107
107
catch {
108
- XCTAssert ( false )
108
+ XCTFail ( " Wrong error thrown " )
109
109
}
110
110
111
111
do {
@@ -116,7 +116,7 @@ class HTMLEntitiesTests: XCTestCase {
116
116
XCTAssert ( true )
117
117
}
118
118
catch {
119
- XCTAssert ( false )
119
+ XCTFail ( " Wrong error thrown " )
120
120
}
121
121
}
122
122
@@ -135,23 +135,24 @@ class HTMLEntitiesTests: XCTestCase {
135
135
136
136
do {
137
137
_ = try decEscaped. htmlUnescape ( strict: true )
138
- XCTAssert ( false )
138
+ XCTFail ( " Did not throw error " )
139
139
}
140
140
catch ParseError . OutsideValidUnicodeRange {
141
141
XCTAssert ( true )
142
142
}
143
143
catch {
144
- XCTAssert ( false )
144
+ XCTFail ( " Wrong error thrown " )
145
145
}
146
146
147
147
do {
148
148
_ = try hexEscaped. htmlUnescape ( strict: true )
149
+ XCTFail ( " Did not throw error " )
149
150
}
150
151
catch ParseError . OutsideValidUnicodeRange {
151
152
XCTAssert ( true )
152
153
}
153
154
catch {
154
- XCTAssert ( false )
155
+ XCTFail ( " Wrong error thrown " )
155
156
}
156
157
}
157
158
@@ -178,24 +179,24 @@ class HTMLEntitiesTests: XCTestCase {
178
179
179
180
do {
180
181
_ = try decEscaped. htmlUnescape ( strict: true )
181
- XCTAssert ( false )
182
+ XCTFail ( " Did not throw error " )
182
183
}
183
184
catch ParseError . DisallowedNumericReference {
184
185
XCTAssert ( true )
185
186
}
186
187
catch {
187
- XCTAssert ( false )
188
+ XCTFail ( " Wrong error thrown " )
188
189
}
189
190
190
191
do {
191
192
_ = try hexEscaped. htmlUnescape ( strict: true )
192
- XCTAssert ( false )
193
+ XCTFail ( " Did not throw error " )
193
194
}
194
195
catch ParseError . DisallowedNumericReference {
195
196
XCTAssert ( true )
196
197
}
197
198
catch {
198
- XCTAssert ( false )
199
+ XCTFail ( " Wrong error thrown " )
199
200
}
200
201
}
201
202
}
@@ -238,41 +239,41 @@ class HTMLEntitiesTests: XCTestCase {
238
239
239
240
do {
240
241
_ = try " 한 " . htmlUnescape ( strict: true )
241
- XCTAssert ( false )
242
+ XCTFail ( " Did not throw error " )
242
243
}
243
244
catch ParseError . MissingSemicolon {
244
245
XCTAssert ( true )
245
246
}
246
247
catch {
247
- XCTAssert ( false )
248
+ XCTFail ( " Wrong error thrown " )
248
249
}
249
250
250
251
let badEntity = " &some &text; here <script> some more; text here; "
251
252
XCTAssertEqual ( badEntity. htmlUnescape ( ) , " &some &text; here <script> some more; text here; " )
252
253
253
254
do {
254
255
_ = try badEntity. htmlUnescape ( strict: true )
255
- XCTAssert ( false )
256
+ XCTFail ( " Did not throw error " )
256
257
}
257
258
catch ParseError . InvalidNamedReference {
258
259
XCTAssert ( true )
259
260
}
260
261
catch {
261
- XCTAssert ( false )
262
+ XCTFail ( " Wrong error thrown " )
262
263
}
263
264
264
265
let legacyEmbedded = " I'm ¬it; I tell you "
265
266
XCTAssertEqual ( legacyEmbedded. htmlUnescape ( ) , " I'm ¬it; I tell you " )
266
267
267
268
do {
268
269
_ = try legacyEmbedded. htmlUnescape ( strict: true )
269
- XCTAssert ( false )
270
+ XCTFail ( " Did not throw error " )
270
271
}
271
272
catch ParseError . MissingSemicolon {
272
273
XCTAssert ( true )
273
274
}
274
275
catch {
275
- XCTAssert ( false )
276
+ XCTFail ( " Wrong error thrown " )
276
277
}
277
278
278
279
XCTAssertEqual ( try " &∾̳ " . htmlUnescape ( strict: true ) , " &∾̳ " )
@@ -281,26 +282,26 @@ class HTMLEntitiesTests: XCTestCase {
281
282
282
283
do {
283
284
_ = try " &#∾̳ " . htmlUnescape ( strict: true )
284
- XCTAssert ( false )
285
+ XCTFail ( " Did not throw error " )
285
286
}
286
287
catch ParseError . MalformedNumericReference {
287
288
XCTAssert ( true )
288
289
}
289
290
catch {
290
- XCTAssert ( false )
291
+ XCTFail ( " Wrong error thrown " )
291
292
}
292
293
293
294
XCTAssertEqual ( " {∾̳ " . htmlUnescape ( ) , " {∾̳ " )
294
295
295
296
do {
296
297
_ = try " {∾̳ " . htmlUnescape ( strict: true )
297
- XCTAssert ( false )
298
+ XCTFail ( " Did not throw error " )
298
299
}
299
300
catch ParseError . MissingSemicolon {
300
301
XCTAssert ( true )
301
302
}
302
303
catch {
303
- XCTAssert ( false )
304
+ XCTFail ( " Wrong error thrown " )
304
305
}
305
306
306
307
XCTAssertEqual ( " ઼∾̳ " . htmlUnescape ( ) , " ઼∾̳ " )
@@ -335,13 +336,13 @@ class HTMLEntitiesTests: XCTestCase {
335
336
336
337
do {
337
338
_ = try text. htmlUnescape ( strict: true )
338
- XCTAssert ( false )
339
+ XCTFail ( " Did not throw error " )
339
340
}
340
341
catch ParseError . MissingSemicolon {
341
342
XCTAssert ( true )
342
343
}
343
344
catch {
344
- XCTAssert ( false )
345
+ XCTFail ( " Wrong error thrown " )
345
346
}
346
347
}
347
348
0 commit comments