@@ -39,7 +39,7 @@ struct NodeData {
39
39
40
40
impl VoidPtrLike for TestNode {
41
41
fn from_void_ptr ( node : * libc:: c_void ) -> TestNode {
42
- fail_unless ! ( node. is_not_null( ) ) ;
42
+ assert ! ( node. is_not_null( ) ) ;
43
43
TestNode ( unsafe {
44
44
let box = cast:: reinterpret_cast ( & node) ;
45
45
cast:: bump_box_refcount ( box) ;
@@ -111,7 +111,7 @@ fn test_background_color_simple() {
111
111
let style = " div { background-color: #123456 ; } ";
112
112
do single_div_test(style) |computed| {
113
113
let color = computed.background_color();
114
- fail_unless !(color == Specified(rgb(0x12, 0x34, 0x56)));
114
+ assert !(color == Specified(rgb(0x12, 0x34, 0x56)));
115
115
}
116
116
}
117
117
@@ -120,7 +120,7 @@ fn test_border_top_width_px() {
120
120
let style = " div { border-top-width: 10 px; } ";
121
121
do single_div_test(style) |computed| {
122
122
let width = computed.border_top_width();
123
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
123
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
124
124
}
125
125
}
126
126
@@ -129,7 +129,7 @@ fn test_border_right_width_px() {
129
129
let style = " div { border-right-width: 10 px; } ";
130
130
do single_div_test(style) |computed| {
131
131
let width = computed.border_right_width();
132
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
132
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
133
133
}
134
134
}
135
135
@@ -138,7 +138,7 @@ fn test_border_bottom_width_px() {
138
138
let style = " div { border-bottom-width: 10 px; } ";
139
139
do single_div_test(style) |computed| {
140
140
let width = computed.border_bottom_width();
141
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
141
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
142
142
}
143
143
}
144
144
@@ -147,7 +147,7 @@ fn test_border_left_width_px() {
147
147
let style = " div { border-left-width: 10 px; } ";
148
148
do single_div_test(style) |computed| {
149
149
let width = computed.border_left_width();
150
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
150
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
151
151
}
152
152
}
153
153
@@ -156,13 +156,13 @@ fn test_border_width_px() {
156
156
let style = " div { border-width: 10 px; } ";
157
157
do single_div_test(style) |computed| {
158
158
let width = computed.border_top_width();
159
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
159
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
160
160
let width = computed.border_right_width();
161
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
161
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
162
162
let width = computed.border_bottom_width();
163
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
163
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
164
164
let width = computed.border_left_width();
165
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
165
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
166
166
}
167
167
}
168
168
@@ -179,10 +179,10 @@ fn test_border_color() {
179
179
let right_color = computed.border_right_color();
180
180
let bottom_color = computed.border_bottom_color();
181
181
let left_color = computed.border_left_color();
182
- fail_unless !(top_color == Specified(rgb(255, 0, 0)));
183
- fail_unless !(right_color == Specified(rgb(0, 128, 0)));
184
- fail_unless !(bottom_color == Specified(rgb(0, 0, 255)));
185
- fail_unless !(left_color == Specified(rgb(255, 255, 0)));
182
+ assert !(top_color == Specified(rgb(255, 0, 0)));
183
+ assert !(right_color == Specified(rgb(0, 128, 0)));
184
+ assert !(bottom_color == Specified(rgb(0, 0, 255)));
185
+ assert !(left_color == Specified(rgb(255, 255, 0)));
186
186
}
187
187
}
188
188
@@ -196,10 +196,10 @@ fn test_border_color_shorthand() {
196
196
let right_color = computed.border_right_color();
197
197
let bottom_color = computed.border_bottom_color();
198
198
let left_color = computed.border_left_color();
199
- fail_unless !(top_color == Specified(rgb(255, 0, 0)));
200
- fail_unless !(right_color == Specified(rgb(255, 0, 0)));
201
- fail_unless !(bottom_color == Specified(rgb(255, 0, 0)));
202
- fail_unless !(left_color == Specified(rgb(255, 0, 0)));
199
+ assert !(top_color == Specified(rgb(255, 0, 0)));
200
+ assert !(right_color == Specified(rgb(255, 0, 0)));
201
+ assert !(bottom_color == Specified(rgb(255, 0, 0)));
202
+ assert !(left_color == Specified(rgb(255, 0, 0)));
203
203
}
204
204
}
205
205
@@ -212,62 +212,62 @@ fn test_margin() {
212
212
margin-left: auto; \
213
213
} ";
214
214
do single_div_test(style) |computed| {
215
- fail_unless !(computed.margin_top() == Specified(CSSMarginLength(Px(10.0))));
216
- fail_unless !(computed.margin_right() == Specified(CSSMarginLength(Px(20.0))));
217
- fail_unless !(computed.margin_bottom() == Specified(CSSMarginLength(Px(30.0))));
218
- fail_unless !(computed.margin_left() == Specified(CSSMarginAuto));
215
+ assert !(computed.margin_top() == Specified(CSSMarginLength(Px(10.0))));
216
+ assert !(computed.margin_right() == Specified(CSSMarginLength(Px(20.0))));
217
+ assert !(computed.margin_bottom() == Specified(CSSMarginLength(Px(30.0))));
218
+ assert !(computed.margin_left() == Specified(CSSMarginAuto));
219
219
}
220
220
}
221
221
222
222
#[test]
223
223
fn test_display() {
224
224
let style = " div { display: none; } ";
225
225
do single_div_test(style) |computed| {
226
- fail_unless !(computed.display(false) == Specified(CSSDisplayNone));
226
+ assert !(computed.display(false) == Specified(CSSDisplayNone));
227
227
}
228
228
}
229
229
230
230
#[test]
231
231
fn test_float() {
232
232
let style = " div { float: right; } ";
233
233
do single_div_test(style) |computed| {
234
- fail_unless !(computed.float() == Specified(CSSFloatRight));
234
+ assert !(computed.float() == Specified(CSSFloatRight));
235
235
}
236
236
}
237
237
238
238
#[test]
239
239
fn test_position() {
240
240
let style = " div { position: static ; } ";
241
241
do single_div_test(style) |computed| {
242
- fail_unless !(computed.position() == Specified(CSSPositionStatic));
242
+ assert !(computed.position() == Specified(CSSPositionStatic));
243
243
}
244
244
let style = " div { position: relative; } ";
245
245
do single_div_test(style) |computed| {
246
- fail_unless !(computed.position() == Specified(CSSPositionRelative));
246
+ assert !(computed.position() == Specified(CSSPositionRelative));
247
247
}
248
248
let style = " div { position: absolute; } ";
249
249
do single_div_test(style) |computed| {
250
- fail_unless !(computed.position() == Specified(CSSPositionAbsolute));
250
+ assert !(computed.position() == Specified(CSSPositionAbsolute));
251
251
}
252
252
let style = " div { position: fixed; } ";
253
253
do single_div_test(style) |computed| {
254
- fail_unless !(computed.position() == Specified(CSSPositionFixed));
254
+ assert !(computed.position() == Specified(CSSPositionFixed));
255
255
}
256
256
}
257
257
258
258
#[test]
259
259
fn test_width() {
260
260
let style = " div { width: 10 px; } ";
261
261
do single_div_test(style) |computed| {
262
- fail_unless !(computed.width() == Specified(CSSWidthLength(Px(10.0))));
262
+ assert !(computed.width() == Specified(CSSWidthLength(Px(10.0))));
263
263
}
264
264
}
265
265
266
266
#[test]
267
267
fn test_height() {
268
268
let style = " div { height: 10 px; } ";
269
269
do single_div_test(style) |computed| {
270
- fail_unless !(computed.height() == Specified(CSSHeightLength(Px(10.0))));
270
+ assert !(computed.height() == Specified(CSSHeightLength(Px(10.0))));
271
271
}
272
272
}
273
273
@@ -279,15 +279,15 @@ fn test_font_family_generic() {
279
279
do single_div_test(style) |computed| {
280
280
let fam = computed.font_family();
281
281
let spec = Specified(~[CSSFontFamilyGenericFamily(Fantasy)]);
282
- fail_unless !(fam.eq(&spec));
282
+ assert !(fam.eq(&spec));
283
283
}
284
284
}
285
285
286
286
#[test]
287
287
fn test_font_family_specific() {
288
288
let style = " div { font-family: Wombat , Jones ; } ";
289
289
do single_div_test(style) |computed| {
290
- fail_unless !(computed.font_family() == Specified(~[
290
+ assert !(computed.font_family() == Specified(~[
291
291
CSSFontFamilyFamilyName(~" Wombat "),
292
292
CSSFontFamilyFamilyName(~" Jones ")
293
293
]));
@@ -299,59 +299,59 @@ fn test_font_family_specific() {
299
299
fn test_font_size() {
300
300
let style = " div { font-size: 10 pt; } ";
301
301
do single_div_test(style) |computed| {
302
- fail_unless !(computed.font_size() == Specified(CSSFontSizeLength(Pt(10.0))));
302
+ assert !(computed.font_size() == Specified(CSSFontSizeLength(Pt(10.0))));
303
303
}
304
304
let style = " div { font-size: 10 %; } ";
305
305
do single_div_test(style) |computed| {
306
- fail_unless !(computed.font_size() == Specified(CSSFontSizePercentage(10.0)));
306
+ assert !(computed.font_size() == Specified(CSSFontSizePercentage(10.0)));
307
307
}
308
308
let style = " div { font-size: small; } ";
309
309
do single_div_test(style) |computed| {
310
- fail_unless !(computed.font_size() == Specified(CSSFontSizeAbsoluteSize(Small)));
310
+ assert !(computed.font_size() == Specified(CSSFontSizeAbsoluteSize(Small)));
311
311
}
312
312
let style = " div { font-size: smaller; } ";
313
313
do single_div_test(style) |computed| {
314
- fail_unless !(computed.font_size() == Specified(CSSFontSizeRelativeSize(Smaller)));
314
+ assert !(computed.font_size() == Specified(CSSFontSizeRelativeSize(Smaller)));
315
315
}
316
316
}
317
317
318
318
#[test]
319
319
fn test_font_style() {
320
320
let style = " div { font-style: oblique; } ";
321
321
do single_div_test(style) |computed| {
322
- fail_unless !(computed.font_style() == Specified(CSSFontStyleOblique));
322
+ assert !(computed.font_style() == Specified(CSSFontStyleOblique));
323
323
}
324
324
}
325
325
326
326
#[test]
327
327
fn test_font_weight() {
328
328
let style = " div { font-weight: bold; } ";
329
329
do single_div_test(style) |computed| {
330
- fail_unless !(computed.font_weight() == Specified(CSSFontWeightBold));
330
+ assert !(computed.font_weight() == Specified(CSSFontWeightBold));
331
331
}
332
332
}
333
333
334
334
#[test]
335
335
fn test_text_align() {
336
336
let style = " div { text-align: center; } ";
337
337
do single_div_test(style) |computed| {
338
- fail_unless !(computed.text_align() == Specified(CSSTextAlignCenter));
338
+ assert !(computed.text_align() == Specified(CSSTextAlignCenter));
339
339
}
340
340
}
341
341
342
342
#[test]
343
343
fn test_id_selector() {
344
344
let style = " #id1 { text-align: center; } ";
345
345
do single_div_test(style) |computed| {
346
- fail_unless !(computed.text_align() == Specified(CSSTextAlignCenter));
346
+ assert !(computed.text_align() == Specified(CSSTextAlignCenter));
347
347
}
348
348
}
349
349
350
350
#[test]
351
351
fn test_line_height() {
352
352
let style = " div { line-height: 2 ; } ";
353
353
do single_div_test(style) |computed| {
354
- fail_unless !(computed.line_height() == Specified(CSSLineHeightNumber(2.0)));
354
+ assert !(computed.line_height() == Specified(CSSLineHeightNumber(2.0)));
355
355
}
356
356
}
357
357
@@ -385,7 +385,7 @@ fn test_child() {
385
385
let style = " div > span { border-left-width: 10 px; } ";
386
386
do child_test(style) |computed| {
387
387
let width = computed.border_left_width();
388
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
388
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
389
389
}
390
390
}
391
391
@@ -394,7 +394,7 @@ fn test_not_child() {
394
394
let style = " div > not_span { border-left-width: 10 px; } ";
395
395
do child_test(style) |computed| {
396
396
let width = computed.border_left_width();
397
- fail_unless !(width != Specified(CSSBorderWidthLength(Px(10.0))));
397
+ assert !(width != Specified(CSSBorderWidthLength(Px(10.0))));
398
398
}
399
399
}
400
400
@@ -404,7 +404,7 @@ fn test_descendant() {
404
404
let style = " div span { border-left-width: 10 px; } ";
405
405
do child_test(style) |computed| {
406
406
let width = computed.border_left_width();
407
- fail_unless !(width == Specified(CSSBorderWidthLength(Px(10.0))));
407
+ assert !(width == Specified(CSSBorderWidthLength(Px(10.0))));
408
408
}
409
409
}
410
410
@@ -442,5 +442,5 @@ fn test_compose() {
442
442
443
443
let computed = complete_child_results. computed_style ( ) ;
444
444
445
- fail_unless ! ( computed. background_color( ) == color:: css_colors:: blue( ) ) ;
445
+ assert ! ( computed. background_color( ) == color:: css_colors:: blue( ) ) ;
446
446
}
0 commit comments