| 1 | |
| 2 | |
| 3 | use super::*; |
| 4 | use crate::menus::RowItem; |
| 5 | use crate::ui::cards::numedit::NumTarget; |
| 6 | |
| 7 | #[test] |
| 8 | fn eq_numbers_read_the_way_the_card_shows_them() { |
| 9 | assert_eq!(NumTarget::Gain.shown(4.5), "+4.5"); |
| 10 | assert_eq!(NumTarget::Gain.shown(-3.0), "\u{2212}3.0"); |
| 11 | assert_eq!(NumTarget::Width.shown(0.707), "0.71"); |
| 12 | } |
| 13 | |
| 14 | #[test] |
| 15 | fn the_proxy_switches_say_proxy_so_a_search_finds_them() { |
| 16 | assert_eq!(RowItem::Proxy.label(), "Make editing copy"); |
| 17 | assert!(keymap::ActionId::ToggleProxies.label().to_lowercase().contains("proxies")); |
| 18 | assert!(keymap::ActionId::ToggleAutoProxies.label().to_lowercase().contains("proxies")); |
| 19 | } |
| 20 | |
| 21 | #[test] |
| 22 | fn only_a_subtitle_clip_gets_the_subtitle_style_section() { |
| 23 | let src = include_str!("../ui/dock_stance.rs"); |
| 24 | assert!(src.contains("let substyle = match on_subtitle {")); |
| 25 | } |
| 26 | |
| 27 | #[test] |
| 28 | fn freq_numbers_scrub_by_octaves_and_read_in_hz_or_khz() { |
| 29 | assert_eq!(NumTarget::Freq.shown(1234.4), "1.2"); |
| 30 | assert_eq!(NumTarget::Freq.shown(432.4), "432"); |
| 31 | let up = NumTarget::Freq.scrub(100., 50., false); |
| 32 | assert!((up - 200.).abs() < 1e-6); |
| 33 | assert_eq!(NumTarget::Freq.scrub(100., -10_000., false), 20.); |
| 34 | } |