summaryrefslogtreecommitdiff
path: root/morphology-img/tests/file_gen.rs
diff options
context:
space:
mode:
Diffstat (limited to 'morphology-img/tests/file_gen.rs')
-rw-r--r--morphology-img/tests/file_gen.rs23
1 files changed, 14 insertions, 9 deletions
diff --git a/morphology-img/tests/file_gen.rs b/morphology-img/tests/file_gen.rs
index e459688..167a9d8 100644
--- a/morphology-img/tests/file_gen.rs
+++ b/morphology-img/tests/file_gen.rs
@@ -456,13 +456,14 @@ fn test_generate_ly_files_preserves_order() {
let content = fs::read_to_string(path).unwrap();
// Verify the content corresponds to the right sequence
- // Sequence with Value::new(outer, 0) and length 1 gives pitch = outer * 1 + 0 = outer
- // Then integer_to_pitch_name: 5→g', 3→e', 1→c'
- // (5+6=11, 11%7=4→"g", 11/7=1→') (3+6=9, 9%7=2→"e", 9/7=1→') (1+6=7, 7%7=0→"c", 7/7=1→')
+ // Sequence with Value::new(outer, 0), max_abs_inner = 0, multiplier = 3
+ // pitch = outer * 3 + 0
+ // Then integer_to_pitch_name: 15→c''', 9→d'', 3→e'
+ // (15+6=21, 21%7=0→"c", 21/7=3→''') (9+6=15, 15%7=1→"d", 15/7=2→'') (3+6=9, 9%7=2→"e", 9/7=1→')
match i {
- 0 => assert!(content.contains("g'4"), "first file should have sequence 0 content"),
- 1 => assert!(content.contains("e'4"), "second file should have sequence 1 content"),
- 2 => assert!(content.contains("c'4"), "third file should have sequence 2 content"),
+ 0 => assert!(content.contains("c'''4"), "first file should have sequence 0 content"),
+ 1 => assert!(content.contains("d''4"), "second file should have sequence 1 content"),
+ 2 => assert!(content.contains("e'4"), "third file should have sequence 2 content"),
_ => panic!("unexpected index"),
}
}
@@ -522,12 +523,16 @@ fn test_complete_ly_generation_pipeline() {
}
// Verify specific content for first file
+ // Sequence: [(1,0), (-1,1), (-1,0), (0,0)]
+ // max_abs_inner = 1, multiplier = 4
+ // Pitches: 1*4+0=4, -1*4+1=-3, -1*4+0=-4, 0*4+0=0 → f'4 f4 e4 b4
let content0 = fs::read_to_string(&ly_paths[0]).unwrap();
assert!(content0.contains("f'4 f4 e4 b4"), "first file should have correct markup");
// Verify specific content for second file
- // Sequence has length 2: [(0,0), (1,0)]
- // Pitches: 0*2+0=0→b4, 1*2+0=2→d'4
+ // Sequence: [(0,0), (1,0)]
+ // max_abs_inner = 0, multiplier = 3
+ // Pitches: 0*3+0=0→b4, 1*3+0=3→e'4
let content1 = fs::read_to_string(&ly_paths[1]).unwrap();
- assert!(content1.contains("b4 d'4"), "second file should have correct markup");
+ assert!(content1.contains("b4 e'4"), "second file should have correct markup");
}