mirror of
https://github.com/dredozubov/polyrhythmix.git
synced 2024-11-22 03:47:43 +00:00
Add more tests
This commit is contained in:
parent
352f79a03f
commit
15db009e60
1 changed files with 13 additions and 0 deletions
|
@ -186,6 +186,11 @@ impl KnownLength for ModdedLength {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_known_length_modded_length() {
|
||||
assert_eq!(ModdedLength::Dotted(BasicLength::Eighth).to_128th(), 24);
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Length {
|
||||
Simple(ModdedLength),
|
||||
|
@ -203,6 +208,14 @@ impl KnownLength for Length {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_known_length_of_length() {
|
||||
let dotted_eighth = ModdedLength::Dotted(BasicLength::Eighth);
|
||||
let triplet_dotted_eighth = Length::Triplet(dotted_eighth);
|
||||
assert_eq!(Length::Tied(dotted_eighth, dotted_eighth).to_128th(), 48);
|
||||
assert_eq!(triplet_dotted_eighth.to_128th(), 16);
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Note {
|
||||
Hit,
|
||||
|
|
Loading…
Reference in a new issue