Skip to content

Commit 3af816a

Browse files
committed
Tests: Move ignored test comments into #[ignore] attribute
Don't know where the reason strings appear (or if they even do), but this feels more correct.
1 parent da794ec commit 3af816a

16 files changed

+105
-194
lines changed

lofty/tests/taglib/test_aiff.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ fn test_save_id3v23() {
126126
}
127127

128128
#[test_log::test]
129-
#[ignore]
130-
fn test_duplicate_id3v2() {
131-
// Marker test, Lofty will overwrite values in the original tag with any new values it finds in the next tag.
132-
}
129+
#[ignore = "Marker test, Lofty will overwrite values in the original tag with any new values it \
130+
finds in the next tag."]
131+
fn test_duplicate_id3v2() {}
133132

134133
#[test_log::test]
135134
fn test_fuzzed_file1() {
@@ -144,7 +143,6 @@ fn test_fuzzed_file1() {
144143
}
145144

146145
#[test_log::test]
147-
#[ignore]
148-
fn test_fuzzed_file2() {
149-
// Marker test, this file doesn't even have a valid signature. No idea how TagLib manages to read it.
150-
}
146+
#[ignore = "Marker test, this file doesn't even have a valid signature. No idea how TagLib manages \
147+
to read it."]
148+
fn test_fuzzed_file2() {}

lofty/tests/taglib/test_apetag.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ fn test_is_empty_2() {
3131
}
3232

3333
#[test_log::test]
34-
#[ignore]
35-
fn test_property_interface_1() {
36-
// Marker test, Lofty does not replicate the TagLib property API
37-
}
34+
#[ignore = "Marker test, Lofty does not replicate the TagLib property API"]
35+
fn test_property_interface_1() {}
3836

3937
#[test_log::test]
40-
#[ignore]
41-
fn test_property_interface_2() {
42-
// Marker test, Lofty does not replicate the TagLib property API
43-
}
38+
#[ignore = "Marker test, Lofty does not replicate the TagLib property API"]
39+
fn test_property_interface_2() {}
4440

4541
#[test_log::test]
4642
fn test_invalid_keys() {

lofty/tests/taglib/test_fileref.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,8 @@ fn test_unsupported() {
191191
}
192192

193193
#[test_log::test]
194-
#[ignore]
195-
fn test_create() {
196-
// Marker test, Lofty does not replicate this API
197-
}
194+
#[ignore = "Marker test, Lofty does not replicate this API"]
195+
fn test_create() {}
198196

199197
#[test_log::test]
200198
fn test_audio_properties() {
@@ -205,10 +203,8 @@ fn test_audio_properties() {
205203
}
206204

207205
#[test_log::test]
208-
#[ignore]
209-
fn test_default_file_extensions() {
210-
// Marker test, Lofty does not replicate this API
211-
}
206+
#[ignore = "Marker test, Lofty does not replicate this API"]
207+
fn test_default_file_extensions() {}
212208

213209
use lofty::io::{FileLike, Length, Truncate};
214210
use lofty::properties::FileProperties;

lofty/tests/taglib/test_flac.rs

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ fn test_signature() {
2121
}
2222

2323
#[test_log::test]
24-
#[ignore]
24+
#[ignore = "Marker test, Lofty does not replicate TagLib's behavior here"]
2525
fn test_multiple_comment_blocks() {
26-
// Marker test, Lofty does not replicate TagLib's behavior
27-
//
2826
// TagLib will use the *first* tag in the stream, while we use the latest.
2927
}
3028

@@ -213,10 +211,9 @@ fn test_repeated_save_1() {
213211
}
214212

215213
#[test_log::test]
216-
#[ignore]
217-
fn test_repeated_save_2() {
218-
// Marker test, this test relies on saving an ID3v2 tag in a FLAC file, something Lofty does not and will not support.
219-
}
214+
#[ignore = "Marker test, this test relies on saving an ID3v2 tag in a FLAC file, something Lofty \
215+
does not and will not support."]
216+
fn test_repeated_save_2() {}
220217

221218
// TODO: We don't make use of padding blocks yet
222219
#[test_log::test]
@@ -264,10 +261,8 @@ fn test_save_multiple_values() {
264261
}
265262

266263
#[test_log::test]
267-
#[ignore]
268-
fn test_dict() {
269-
// Marker test, Lofty does not replicate the dict API
270-
}
264+
#[ignore = "Marker test, Lofty does not replicate the dict API"]
265+
fn test_dict() {}
271266

272267
#[test_log::test]
273268
fn test_properties() {
@@ -457,16 +452,14 @@ fn test_shrink_padding() {
457452
}
458453

459454
#[test_log::test]
460-
#[ignore]
461-
fn test_save_id3v1() {
462-
// Marker test, this test relies on saving an ID3v1 tag in a FLAC file, something Lofty does not and will not support.
463-
}
455+
#[ignore = "Marker test, this test relies on saving an ID3v1 tag in a FLAC file, something Lofty \
456+
does not and will not support."]
457+
fn test_save_id3v1() {}
464458

465459
#[test_log::test]
466-
#[ignore]
467-
fn test_update_id3v2() {
468-
// Marker test, this test relies on saving an ID3v2 tag in a FLAC file, something Lofty does not and will not support.
469-
}
460+
#[ignore = "Marker test, this test relies on saving an ID3v2 tag in a FLAC file, something Lofty \
461+
does not and will not support."]
462+
fn test_update_id3v2() {}
470463

471464
#[test_log::test]
472465
fn test_empty_id3v2() {

lofty/tests/taglib/test_id3v1.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use lofty::id3::v1::GENRES;
22

33
#[test_log::test]
4-
#[ignore]
5-
fn test_strip_whitespace() {
6-
// Marker test, we'd be overstepping to remove trailing whitespace that may be intentional
7-
}
4+
#[ignore = "Marker test, we'd be overstepping to remove trailing whitespace that may be intentional"]
5+
fn test_strip_whitespace() {}
86

97
#[test_log::test]
108
fn test_genres() {

lofty/tests/taglib/test_id3v2.rs

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,8 @@ fn test_broken_frame1() {
202202
}
203203

204204
#[test_log::test]
205-
#[ignore]
206-
fn test_read_string_field() {
207-
// Marker test, this is not an API Lofty replicates
208-
}
205+
#[ignore = "Marker test, this is not an API Lofty replicates"]
206+
fn test_read_string_field() {}
209207

210208
#[test_log::test]
211209
fn test_parse_apic() {
@@ -288,10 +286,8 @@ fn test_render_apic() {
288286
}
289287

290288
#[test_log::test]
291-
#[ignore]
292-
fn test_dont_render22() {
293-
// Marker test, not sure what's going on here?
294-
}
289+
#[ignore = "Marker test, not sure what's going on here?"]
290+
fn test_dont_render22() {}
295291

296292
#[test_log::test]
297293
fn test_parse_geob() {
@@ -374,10 +370,8 @@ fn test_render_popm() {
374370
}
375371

376372
#[test_log::test]
377-
#[ignore]
378-
fn test_popm_to_string() {
379-
// Marker test, Lofty doesn't have a display impl for Popularimeter
380-
}
373+
#[ignore = "Marker test, Lofty doesn't have a display impl for Popularimeter"]
374+
fn test_popm_to_string() {}
381375

382376
#[test_log::test]
383377
fn test_popm_from_file() {
@@ -783,16 +777,12 @@ fn test_render_comments_frame() {
783777
}
784778

785779
#[test_log::test]
786-
#[ignore]
787-
fn test_parse_podcast_frame() {
788-
// Marker test, Lofty doesn't have dedicated support for PCST frames, it seems unnecessary
789-
}
780+
#[ignore = "Marker test, Lofty doesn't have dedicated support for PCST frames, it seems unnecessary"]
781+
fn test_parse_podcast_frame() {}
790782

791783
#[test_log::test]
792-
#[ignore]
793-
fn test_render_podcast_frame() {
794-
// Marker test, Lofty doesn't have dedicated support for PCST frames, it seems unnecessary
795-
}
784+
#[ignore = "Marker test, Lofty doesn't have dedicated support for PCST frames, it seems unnecessary"]
785+
fn test_render_podcast_frame() {}
796786

797787
#[test_log::test]
798788
fn test_parse_private_frame() {
@@ -1285,28 +1275,22 @@ fn test_w000() {
12851275
}
12861276

12871277
#[test_log::test]
1288-
#[ignore]
1289-
fn test_property_interface() {
1290-
// Marker test, Lofty does not replicate the property interface
1291-
}
1278+
#[ignore = "Marker test, Lofty does not replicate the property interface"]
1279+
fn test_property_interface() {}
12921280

12931281
#[test_log::test]
1294-
#[ignore]
1295-
fn test_property_interface2() {
1296-
// Marker test, Lofty does not replicate the property interface
1297-
}
1282+
#[ignore = "Marker test, Lofty does not replicate the property interface"]
1283+
fn test_property_interface2() {}
12981284

12991285
#[test_log::test]
1300-
#[ignore]
1286+
#[ignore = "Marker test, Lofty does not replicate the property interface"]
13011287
fn test_properties_movement() {
1302-
// Marker test, Lofty does not replicate the property interface.
13031288
// Outside of that, this is simply a text frame parsing test, which is redundant.
13041289
}
13051290

13061291
#[test_log::test]
1307-
#[ignore]
1292+
#[ignore = "Marker test, Lofty does not replicate the property interface"]
13081293
fn test_property_grouping() {
1309-
// Marker test, Lofty does not replicate the property interface.
13101294
// Outside of that, this is simply a text frame parsing test, which is redundant.
13111295
}
13121296

@@ -1382,16 +1366,12 @@ fn test_parse_table_of_contents_frame() {}
13821366
fn test_render_table_of_contents_frame() {}
13831367

13841368
#[test_log::test]
1385-
#[ignore]
1386-
fn test_empty_frame() {
1387-
// Marker test, Lofty will not remove empty frames, as they can be valid
1388-
}
1369+
#[ignore = "Marker test, Lofty will not remove empty frames, as they can be valid"]
1370+
fn test_empty_frame() {}
13891371

13901372
#[test_log::test]
1391-
#[ignore]
1392-
fn test_duplicate_tags() {
1393-
// Marker test, Lofty will combine duplicated tags
1394-
}
1373+
#[ignore = "Marker test, Lofty will combine duplicated tags"]
1374+
fn test_duplicate_tags() {}
13951375

13961376
// TODO: Support CTOC frames (#189)
13971377
#[test_log::test]

lofty/tests/taglib/test_mp4.rs

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,9 @@ fn test_save_existing_when_ilst_is_last() {
259259
}
260260

261261
#[test_log::test]
262-
#[ignore]
263-
fn test_64bit_atom() {
264-
// Marker test, this just checks the moov atom's length. We don't retain any atoms we don't need.
265-
}
262+
#[ignore = "Marker test, this just checks the moov atom's length. We don't retain any atoms we \
263+
don't need."]
264+
fn test_64bit_atom() {}
266265

267266
#[test_log::test]
268267
fn test_gnre() {
@@ -355,22 +354,16 @@ fn test_covr_read2() {
355354
}
356355

357356
#[test_log::test]
358-
#[ignore]
359-
fn test_properties() {
360-
// Marker test, Lofty does not replicate the properties API
361-
}
357+
#[ignore = "Marker test, Lofty does not replicate the properties API"]
358+
fn test_properties() {}
362359

363360
#[test_log::test]
364-
#[ignore]
365-
fn test_properties_all_supported() {
366-
// Marker test, Lofty does not replicate the properties API
367-
}
361+
#[ignore = "Marker test, Lofty does not replicate the properties API"]
362+
fn test_properties_all_supported() {}
368363

369364
#[test_log::test]
370-
#[ignore]
371-
fn test_properties_movement() {
372-
// Marker test, Lofty does not replicate the properties API
373-
}
365+
#[ignore = "Marker test, Lofty does not replicate the properties API"]
366+
fn test_properties_movement() {}
374367

375368
#[test_log::test]
376369
fn test_fuzzed_file() {
@@ -412,10 +405,8 @@ fn test_with_zero_length_atom() {
412405
}
413406

414407
#[test_log::test]
415-
#[ignore]
416-
fn test_empty_values_remove_items() {
417-
// Marker test, Lofty treats empty values as valid
418-
}
408+
#[ignore = "Marker test, Lofty treats empty values as valid"]
409+
fn test_empty_values_remove_items() {}
419410

420411
#[test_log::test]
421412
fn test_remove_metadata() {

lofty/tests/taglib/test_mpc.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,12 @@ fn test_properties_sv7() {
5757
}
5858

5959
#[test_log::test]
60-
fn test_properties_sv5() {
61-
// Marker test, TagLib doesn't seem to produce the correct properties for SV5
62-
}
60+
#[ignore = "Marker test, TagLib doesn't seem to produce the correct properties for SV5"]
61+
fn test_properties_sv5() {}
6362

6463
#[test_log::test]
65-
#[ignore]
66-
fn test_properties_sv4() {
67-
// Marker test, TagLib doesn't seem to produce the correct properties for SV4
68-
}
64+
#[ignore = "Marker test, TagLib doesn't seem to produce the correct properties for SV4"]
65+
fn test_properties_sv4() {}
6966

7067
#[test_log::test]
7168
fn test_fuzzed_file1() {

0 commit comments

Comments
 (0)