Skip to content

Commit 6f4da08

Browse files
committed
add some manual tests
1 parent 588fcd1 commit 6f4da08

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

tests/test_extract.rs

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,39 @@
1+
use xmodits_lib::module::PcmType;
2+
use xmodits_lib::{load_from_bytes, load_from_path, AudioFormat, Ripper};
3+
14
#[ignore = "for manual testing only"]
25
#[test]
36
fn test_extraction() {
4-
xmodits_lib::extract(
5-
"tests/modules/xm/vagyakozas.xm",
6-
"modules/vagyakozas_xm",
7-
&xmodits_lib::Ripper::default(),
8-
false,
9-
)
10-
.unwrap();
7+
Ripper::default()
8+
.audio_format(AudioFormat::S3I)
9+
.extract_from_path(
10+
"tests/modules/xm/vagyakozas.xm",
11+
"modules/vagyakozas_xm",
12+
false,
13+
)
14+
.unwrap();
1115
}
1216

1317
#[ignore = "for manual testing only"]
1418
#[test]
1519
fn test_info() {
16-
for smp in xmodits_lib::load_from_path("tests/modules/xm/sb-joint.xm")
17-
.unwrap()
18-
.samples()
19-
{
20+
let path = "tests/modules/it/bacter_vs_saga_musix_-_outline_bees.it";
21+
for smp in load_from_path(path).unwrap().samples() {
2022
dbg!(smp);
2123
}
2224
}
25+
26+
#[ignore = "for manual testing only"]
27+
#[test]
28+
fn test_info2() {
29+
let module = include_bytes!("modules/it/test_it.mptm");
30+
let smp = load_from_bytes(module, None).unwrap();
31+
dbg!(smp
32+
.samples()
33+
.iter()
34+
.any(|smp| smp.pcm_type == PcmType::IT214));
35+
dbg!(smp
36+
.samples()
37+
.iter()
38+
.any(|smp| smp.pcm_type == PcmType::IT215));
39+
}

0 commit comments

Comments
 (0)