/* Appellation: pitches Contrib: FL03 */ extern crate rstmt_core as rstmt; use rstmt::pitch::*; fn assert_ok(result: Result) -> T where E: core::fmt::Debug + core::fmt::Display, { assert!(result.is_ok()); result.unwrap() } #[test] fn test_pitch() { let pitch = Pitch::new(0); assert_eq!(pitch.class(), Pitch::new(12).class()); let b = pitch + 1; assert_ne!(pitch, b); assert_eq!(b, Pitch::new(1)); } #[test] fn test_pitch_class() { let pitch = assert_ok(Pitches::try_from_value(12)); let rhs = Natural::C; assert_eq!(pitch, rhs.as_class()); assert_eq!(pitch.value(), 0); }