Skip to content

Commit

Permalink
fmt to look like a readable table
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenesvk committed Dec 29, 2024
1 parent 4c14dee commit 3105b79
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/appkit/event/test.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#[cfg(test)]
#[cfg(test)] #[rustfmt::skip]
mod event_test {
use crate::appkit::EventModifierBitFlag;
#[test]
fn test_event_modifier_bit_flag_display() {
assert_eq!("‹⇧" , format!("{}",EventModifierBitFlag::LeftShift));
assert_eq!("‹⇧›" , format!("{}",EventModifierBitFlag::Shift));
assert_eq!("⇧›" , format!("{}",EventModifierBitFlag::RightShift));
assert_eq!("‹⇧‹⌃‹⌥‹⌘" , format!("{}",EventModifierBitFlag::LeftModi));
assert_eq!("⇧›⌃›⌥›⌘›" , format!("{}",EventModifierBitFlag::RightModi));
assert_eq!("‹⇧›‹⌃›‹⌥›‹⌘›" , format!("{}",EventModifierBitFlag::LRModi));
assert_eq!("🌐" , format!("{:#}",EventModifierBitFlag::Function)); // when it's a modifier key
assert_eq!("ƒ" , format!("{}",EventModifierBitFlag::Function));
assert_eq!("⇭" , format!("{:#}",EventModifierBitFlag::Numpad)); // when it's a modifier key
assert_eq!("🔢" , format!("{}",EventModifierBitFlag::Numpad));
assert_eq!("ℹ" , format!("{}",EventModifierBitFlag::Help));
assert_eq!("!🖮" , format!("{}",EventModifierBitFlag::DeviceIndependentFlagsMask));
assert_eq!("‹⇧" ,format!("{}" ,EventModifierBitFlag::LeftShift ));
assert_eq!("‹⇧›" ,format!("{}" ,EventModifierBitFlag::Shift ));
assert_eq!("⇧›" ,format!("{}" ,EventModifierBitFlag::RightShift ));
assert_eq!("‹⇧‹⌃‹⌥‹⌘" ,format!("{}" ,EventModifierBitFlag::LeftModi ));
assert_eq!("⇧›⌃›⌥›⌘›" ,format!("{}" ,EventModifierBitFlag::RightModi ));
assert_eq!("‹⇧›‹⌃›‹⌥›‹⌘›",format!("{}" ,EventModifierBitFlag::LRModi ));
assert_eq!("🌐" ,format!("{:#}",EventModifierBitFlag::Function )); // when it's a modifier key
assert_eq!("ƒ" ,format!("{}" ,EventModifierBitFlag::Function ));
assert_eq!("⇭" ,format!("{:#}",EventModifierBitFlag::Numpad )); // when it's a modifier key
assert_eq!("🔢" ,format!("{}" ,EventModifierBitFlag::Numpad ));
assert_eq!("ℹ" ,format!("{}" ,EventModifierBitFlag::Help ));
assert_eq!("!🖮" ,format!("{}" ,EventModifierBitFlag::DeviceIndependentFlagsMask));
// Shift ignored, only flagmask remains
assert_eq!("!🖮" , format!("{}",EventModifierBitFlag::DeviceIndependentFlagsMask | EventModifierBitFlag::RightShift));
assert_eq!("!🖮" ,format!("{}" ,EventModifierBitFlag::DeviceIndependentFlagsMask | EventModifierBitFlag::RightShift));
}
}

0 comments on commit 3105b79

Please sign in to comment.