test: fix coverage run

This commit is contained in:
🪞👃🪞 2025-04-26 13:31:09 +03:00
parent 24bc33d3d0
commit 2c59b1acfd
6 changed files with 58 additions and 58 deletions

View file

@ -1,9 +1,41 @@
use crate::*;
mod clip_editor; pub use self::clip_editor::*;
mod clip_launch; pub use self::clip_launch::*;
mod clip_model; pub use self::clip_model::*;
mod clip_play; pub use self::clip_play::*;
mod clip_view; pub use self::clip_view::*;
pub trait HasEditor {
fn editor (&self) -> &Option<MidiEditor>;
fn editor_mut (&mut self) -> &Option<MidiEditor>;
fn is_editing (&self) -> bool { true }
fn editor_w (&self) -> usize { 0 }
fn editor_h (&self) -> usize { 0 }
}
#[macro_export] macro_rules! has_editor {
(|$self:ident: $Struct:ident|{
editor = $e0:expr;
editor_w = $e1:expr;
editor_h = $e2:expr;
is_editing = $e3:expr;
}) => {
impl HasEditor for $Struct {
fn editor (&$self) -> &Option<MidiEditor> { &$e0 }
fn editor_mut (&mut $self) -> &Option<MidiEditor> { &mut $e0 }
fn editor_w (&$self) -> usize { $e1 }
fn editor_h (&$self) -> usize { $e2 }
fn is_editing (&$self) -> bool { $e3 }
}
};
(|$self:ident:$Struct:ident$(<$($L:lifetime),*$($T:ident$(:$U:path)?),*>)?|$cb:expr) => {
impl $(<$($L),*$($T $(: $U)?),*>)? HasEditor for $Struct $(<$($L),*$($T),*>)? {
fn editor (&$self) -> &MidiEditor { &$cb }
}
};
}
#[cfg(test)] #[test] pub fn test_midi_clip () {
let clip = MidiClip::stop_all();
println!("{clip:?}");