generate coverage from correct target

This commit is contained in:
🪞👃🪞 2025-01-22 12:49:15 +01:00
parent be6bd32b78
commit ffe8893bed
8 changed files with 57 additions and 12 deletions

View file

@ -59,3 +59,25 @@ pub fn update_keys (keys: &mut[bool;128], message: &MidiMessage) {
_ => {}
}
}
#[cfg(test)] #[test] pub fn test_midi_clip () {
let clip = MidiClip::stop_all();
println!("{clip:?}");
let clip = MidiClip::default();
let mut clip = MidiClip::new("clip", true, 1, None, None);
clip.set_length(96);
clip.toggle_loop();
clip.record_event(12, midly::MidiMessage::NoteOn { key: 36.into(), vel: 100.into() });
assert!(clip.contains_note_on(36.into(), 6, 18));
assert_eq!(&clip.notes, &clip.duplicate().notes);
let clip = std::sync::Arc::new(clip);
assert_eq!(clip.clone(), clip);
}
#[cfg(test)] #[test] pub fn test_midi_edit () {
let editor = MidiEditor::default();
println!("{editor:?}");
}
#[cfg(test)] #[test] pub fn test_midi_player () {
let player = MidiPlayer::default();
println!("{player:?}");
}

View file

@ -1,3 +1,4 @@
//! MIDI clip data.
use crate::*;
pub trait HasMidiClip {

View file

@ -1,3 +1,4 @@
//! MIDI editor.
use crate::*;
pub trait HasEditor {
fn editor (&self) -> &Option<MidiEditor>;

View file

@ -1,3 +1,4 @@
//! MIDI player
use crate::*;
pub trait HasPlayer {
fn player (&self) -> &impl MidiPlayerApi;