Skip to content

Commit 9f2848c

Browse files
committed
Tests: Unignore TagLib tests, replacing with todo!() panics
1 parent 095ec03 commit 9f2848c

File tree

12 files changed

+148
-144
lines changed

12 files changed

+148
-144
lines changed

tests/taglib/test_aiff.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ fn test_save_id3v2() {
9393
}
9494

9595
#[test]
96-
#[ignore] // TODO: Support writing ID3v2.3 tags
97-
fn test_save_id3v23() {}
96+
fn test_save_id3v23() {
97+
todo!("Support writing ID3v2.3 tags")
98+
}
9899

99100
#[test]
100101
#[ignore]

tests/taglib/test_ape.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,21 @@ fn test_399(path: &str) {
2323
}
2424

2525
#[test]
26-
#[ignore]
2726
fn test_properties_399() {
2827
test_399("tests/taglib/data/mac-399.ape")
2928
}
3029

3130
#[test]
32-
#[ignore]
3331
fn test_properties_399_tagged() {
3432
test_399("tests/taglib/data/mac-399-tagged.ape")
3533
}
3634

3735
#[test]
38-
#[ignore]
3936
fn test_properties_399_id3v2() {
4037
test_399("tests/taglib/data/mac-399-id3v2.ape")
4138
}
4239

4340
#[test]
44-
#[ignore]
4541
fn test_properties_396() {
4642
let f = get_file::<ApeFile>("tests/taglib/data/mac-396.ape");
4743
let properties = f.properties();
@@ -57,7 +53,6 @@ fn test_properties_396() {
5753
}
5854

5955
#[test]
60-
#[ignore]
6156
fn test_properties_390() {
6257
let f = get_file::<ApeFile>("tests/taglib/data/mac-390-hdr.ape");
6358
let properties = f.properties();

tests/taglib/test_apetag.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ fn test_text_binary() {
9191

9292
// TODO: Does not work! We fall for this collision.
9393
#[test]
94-
#[ignore]
9594
fn test_id3v1_collision() {
9695
let mut file = temp_file!("tests/taglib/data/no-tags.mpc");
9796
{

tests/taglib/test_fileref.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ fn file_ref_save(path: &str, expected_file_type: FileType) {
7878
}
7979

8080
#[test]
81-
#[ignore]
8281
fn test_musepack() {
8382
file_ref_save("click.mpc", FileType::Mpc);
8483
}
@@ -202,7 +201,6 @@ fn test_create() {
202201
}
203202

204203
#[test]
205-
#[ignore] // TODO: We're off by over 200ms
206204
fn test_audio_properties() {
207205
let file = lofty::read_from_path("tests/taglib/data/xing.mp3").unwrap();
208206
let properties = file.properties();
@@ -216,8 +214,8 @@ fn test_default_file_extensions() {
216214
// Marker test, Lofty does not replicate this API
217215
}
218216

217+
// TODO: We need to check resolvers *first* and then resort to our default implementations
219218
#[test]
220-
#[ignore] // TODO: We need to check resolvers *first* and then resort to our default implementations
221219
fn test_file_resolver() {
222220
{
223221
let file = lofty::read_from_path("tests/taglib/data/xing.mp3").unwrap();

tests/taglib/test_flac.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ fn test_repeated_save_2() {
219219
// Marker test, this test relies on saving an ID3v2 tag in a FLAC file, something Lofty does not and will not support.
220220
}
221221

222+
// TODO: We don't make use of padding blocks yet
222223
#[test]
223-
#[ignore] // TODO: We don't make use of padding blocks yet
224224
fn test_repeated_save_3() {
225225
let mut file = temp_file!("tests/taglib/data/no-tags.flac");
226226

@@ -422,8 +422,8 @@ fn test_zero_sized_padding_2() {
422422
}
423423
}
424424

425+
// TODO: We don't make use of padding blocks yet
425426
#[test]
426-
#[ignore] // TODO: We don't make use of padding blocks yet
427427
fn test_shrink_padding() {
428428
let mut file = temp_file!("tests/taglib/data/silence-44-s.flac");
429429
{
@@ -478,8 +478,8 @@ fn test_empty_id3v2() {
478478
}
479479
}
480480

481+
// TODO: TagLib doesn't fully remove Vorbis Comments when stripping. It will preserve the vendor string. Should we do the same?
481482
#[test]
482-
#[ignore] // TODO: TagLib doesn't fully remove Vorbis Comments when stripping. It will preserve the vendor string. Should we do the same?
483483
fn test_strip_tags() {
484484
// NOTE: In the TagLib test suite, this also tests ID3v1 and ID3v2. That is not replicated here.
485485

tests/taglib/test_id3v2.rs

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,24 @@ fn test_unsynch_decode() {
3030
}
3131

3232
#[test]
33-
#[ignore] // TODO: We don't support downgrading 2.4 tags to 2.3
34-
fn test_downgrade_utf8_for_id3v23_1() {}
33+
fn test_downgrade_utf8_for_id3v23_1() {
34+
todo!("We don't support downgrading 2.4 tags to 2.3")
35+
}
3536

3637
#[test]
37-
#[ignore] // TODO: We don't support downgrading 2.4 tags to 2.3
38-
fn test_downgrade_utf8_for_id3v23_2() {}
38+
fn test_downgrade_utf8_for_id3v23_2() {
39+
todo!("We don't support downgrading 2.4 tags to 2.3")
40+
}
3941

4042
#[test]
41-
#[ignore] // TODO: Need to think of a nice way to handle multiple UTF-16 values separated by null
42-
fn test_utf16be_delimiter() {}
43+
fn test_utf16be_delimiter() {
44+
todo!("Need to think of a nice way to handle multiple UTF-16 values separated by null")
45+
}
4346

4447
#[test]
45-
#[ignore] // TODO: Need to think of a nice way to handle multiple UTF-16 values separated by null
46-
fn test_utf16_delimiter() {}
48+
fn test_utf16_delimiter() {
49+
todo!("Need to think of a nice way to handle multiple UTF-16 values separated by null")
50+
}
4751

4852
#[test]
4953
fn test_broken_frame1() {
@@ -723,8 +727,8 @@ fn test_render_user_text_identification_frame() {
723727
);
724728
}
725729

730+
// TODO: iTunes, being the great application it is writes unsynchronized integers for sizes. There's no *great* way to detect this.
726731
#[test]
727-
#[ignore] // TODO: iTunes, being the great application it is writes unsynchronized integers for sizes. There's no *great* way to detect this.
728732
fn test_itunes_24_frame_size() {
729733
let mut file = temp_file!("tests/taglib/data/005411.id3");
730734
let f = MpegFile::read_from(&mut file, ParseOptions::new().read_properties(false)).unwrap();
@@ -776,8 +780,9 @@ fn test_save_utf16_comment() {
776780
}
777781

778782
#[test]
779-
#[ignore] // TODO: We don't support downgrading to 2.3 tags yet
780-
fn test_update_genre_23_1() {}
783+
fn test_update_genre_23_1() {
784+
todo!("We don't support downgrading to 2.3 tags yet")
785+
}
781786

782787
#[test]
783788
#[ignore]
@@ -792,8 +797,12 @@ fn test_update_genre23_3() {
792797
}
793798

794799
#[test]
795-
#[ignore] // TODO: We currently just return the genre string as it is in the tag, need to think about whether or not to convert numerical strings
796-
fn test_update_genre_24() {}
800+
fn test_update_genre_24() {
801+
todo!(
802+
"We currently just return the genre string as it is in the tag, need to think about \
803+
whether or not to convert numerical strings"
804+
)
805+
}
797806

798807
#[test]
799808
fn test_update_date22() {
@@ -803,8 +812,8 @@ fn test_update_date22() {
803812
assert_eq!(f.id3v2().unwrap().year(), Some(2010));
804813
}
805814

815+
// TODO: Determine if this is even worth doing. It is just combining TYE+TDA when upgrading ID3v2.2 to 2.4
806816
#[test]
807-
#[ignore] // TODO: Determine if this is even worth doing. It is just combining TYE+TDA when upgrading ID3v2.2 to 2.4
808817
fn test_update_full_date22() {
809818
let mut file = temp_file!("tests/taglib/data/id3v22-tda.mp3");
810819
let f = MpegFile::read_from(&mut file, ParseOptions::new()).unwrap();
@@ -813,8 +822,9 @@ fn test_update_full_date22() {
813822
}
814823

815824
#[test]
816-
#[ignore] // TODO: We don't support downgrading 2.4 tags to 2.3
817-
fn test_downgrade_to_23() {}
825+
fn test_downgrade_to_23() {
826+
todo!("We don't support downgrading 2.4 tags to 2.3")
827+
}
818828

819829
#[test]
820830
fn test_compressed_frame_with_broken_length() {
@@ -932,20 +942,24 @@ fn test_save_and_strip_id3v1_should_not_add_frame_from_id3v1_to_id3v2() {
932942
}
933943

934944
#[test]
935-
#[ignore] // TODO: We don't support CHAP frames yet
936-
fn test_parse_chapter_frame() {}
945+
fn test_parse_chapter_frame() {
946+
todo!("We don't support CHAP frames yet")
947+
}
937948

938949
#[test]
939-
#[ignore] // TODO: We don't support CHAP frames yet
940-
fn test_render_chapter_frame() {}
950+
fn test_render_chapter_frame() {
951+
todo!("We don't support CHAP frames yet")
952+
}
941953

942954
#[test]
943-
#[ignore] // TODO: We don't support CTOC frames yet
944-
fn test_parse_table_of_contents_frame() {}
955+
fn test_parse_table_of_contents_frame() {
956+
todo!("We don't support CTOC frames yet")
957+
}
945958

946959
#[test]
947-
#[ignore] // TODO: We don't support CTOC frames yet
948-
fn test_render_table_of_contents_frame() {}
960+
fn test_render_table_of_contents_frame() {
961+
todo!("We don't support CTOC frames yet")
962+
}
949963

950964
#[test]
951965
#[ignore]
@@ -960,5 +974,6 @@ fn test_duplicate_tags() {
960974
}
961975

962976
#[test]
963-
#[ignore] // TODO: We don't support CTOC frames yet
964-
fn test_parse_toc_frame_with_many_children() {}
977+
fn test_parse_toc_frame_with_many_children() {
978+
todo!("We don't support CTOC frames yet")
979+
}

tests/taglib/test_mp4.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn test_is_empty() {
139139

140140
#[test]
141141
fn test_update_stco() {
142-
// TODO: We don't update stco atoms
142+
todo!("We don't update stco atoms")
143143
}
144144

145145
#[test]
@@ -234,8 +234,11 @@ fn test_save_existing_when_ilst_is_last() {
234234
}
235235

236236
#[test]
237-
#[ignore] // TODO: Maybe? This just checks the moov atom's length. We don't retain any atoms we don't need.
238-
fn test_64bit_atom() {}
237+
fn test_64bit_atom() {
238+
todo!(
239+
"Maybe? This just checks the moov atom's length. We don't retain any atoms we don't need."
240+
)
241+
}
239242

240243
#[test]
241244
fn test_gnre() {

tests/taglib/test_mpeg.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ use lofty::mpeg::MpegFile;
1111
use lofty::{Accessor, AudioFile, ParseOptions};
1212

1313
#[test]
14-
#[ignore]
1514
fn test_audio_properties_xing_header_cbr() {
1615
let f = get_file::<MpegFile>("tests/taglib/data/lame_cbr.mp3");
1716

@@ -25,7 +24,6 @@ fn test_audio_properties_xing_header_cbr() {
2524
}
2625

2726
#[test]
28-
#[ignore]
2927
fn test_audio_properties_xing_header_vbr() {
3028
let f = get_file::<MpegFile>("tests/taglib/data/lame_vbr.mp3");
3129

@@ -39,7 +37,6 @@ fn test_audio_properties_xing_header_vbr() {
3937
}
4038

4139
#[test]
42-
#[ignore]
4340
fn test_audio_properties_vbri_header() {
4441
let f = get_file::<MpegFile>("tests/taglib/data/rare_frames.mp3");
4542

@@ -53,7 +50,6 @@ fn test_audio_properties_vbri_header() {
5350
}
5451

5552
#[test]
56-
#[ignore]
5753
fn test_audio_properties_no_vbr_headers() {
5854
let f = get_file::<MpegFile>("tests/taglib/data/bladeenc.mp3");
5955

@@ -79,7 +75,6 @@ fn test_skip_invalid_frames_1() {
7975
}
8076

8177
#[test]
82-
#[ignore]
8378
fn test_skip_invalid_frames_2() {
8479
let f = get_file::<MpegFile>("tests/taglib/data/invalid-frames2.mp3");
8580

@@ -91,7 +86,6 @@ fn test_skip_invalid_frames_2() {
9186
}
9287

9388
#[test]
94-
#[ignore]
9589
fn test_skip_invalid_frames_3() {
9690
let f = get_file::<MpegFile>("tests/taglib/data/invalid-frames3.mp3");
9791

@@ -103,7 +97,6 @@ fn test_skip_invalid_frames_3() {
10397
}
10498

10599
#[test]
106-
#[ignore]
107100
fn test_version_2_duration_with_xing_header() {
108101
let f = get_file::<MpegFile>("tests/taglib/data/mpeg2.mp3");
109102
assert_eq!(f.properties().duration().as_secs(), 5387); // TODO: Off by 15
@@ -141,8 +134,9 @@ fn test_save_id3v24_wrong_param() {
141134
// Marker test, Lofty does not replicate the TagLib saving API
142135
}
143136

137+
// TODO: We don't yet support writing an ID3v23 tag (#62)
144138
#[test]
145-
#[ignore] // TODO: We don't yet support writing an ID3v23 tag (#62)
139+
#[ignore]
146140
fn test_save_id3v23() {
147141
let mut file = temp_file!("tests/taglib/data/xing.mp3");
148142

@@ -292,8 +286,8 @@ fn test_empty_ape() {
292286
// Marker test, Lofty accepts empty strings as valid values
293287
}
294288

289+
// TODO: We can't find an ID3v2 tag after saving with garbage
295290
#[test]
296-
#[ignore] // TODO: We can't find an ID3v2 tag after saving with garbage
297291
fn test_ignore_garbage() {
298292
let mut file = temp_file!("tests/taglib/data/garbage.mp3");
299293

0 commit comments

Comments
 (0)