mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-06-19 12:13:32 +00:00
feat: better testing (#131)
* add tests * update github actions to include testing step * optimization
This commit is contained in:
committed by
GitHub
parent
0476329798
commit
e91465365d
@@ -30,3 +30,26 @@ impl SoundpadGui {
|
||||
self.draw_footer(ui);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_get_volume_icon() {
|
||||
assert_eq!(SoundpadGui::get_volume_icon(0.8), ICON_VOLUME_UP.codepoint);
|
||||
assert_eq!(SoundpadGui::get_volume_icon(0.0), ICON_VOLUME_OFF.codepoint);
|
||||
assert_eq!(
|
||||
SoundpadGui::get_volume_icon(-0.1),
|
||||
ICON_VOLUME_OFF.codepoint
|
||||
);
|
||||
assert_eq!(
|
||||
SoundpadGui::get_volume_icon(0.2),
|
||||
ICON_VOLUME_MUTE.codepoint
|
||||
);
|
||||
assert_eq!(
|
||||
SoundpadGui::get_volume_icon(0.5),
|
||||
ICON_VOLUME_DOWN.codepoint
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user