Skip to content

Commit

Permalink
fix: unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Decodetalkers committed Dec 5, 2024
1 parent bf636dc commit f1939a2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions iced_layershell/tests/test_macro.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use iced_layershell::actions::IsSingleton;
use iced_layershell::{to_layer_message, windowinfo_marker};
use iced_layershell::actions::{IsSingleton, MainWindowInfo};
use iced_layershell::{to_layer_message, WindowInfoMarker};

#[test]
fn test_layer_message_macro() {
Expand All @@ -15,7 +15,7 @@ fn test_layer_message_macro() {
#[test]
fn test_layersingleton_derive() {
#[allow(unused)]
#[derive(windowinfo_marker)]
#[derive(WindowInfoMarker)]
enum SingleToneTest {
#[singleton]
SingleTon,
Expand All @@ -26,9 +26,15 @@ fn test_layersingleton_derive() {
},
#[singleton]
SingleTonThird(i32),
#[main]
Main,
}
assert!(SingleToneTest::SingleTon.is_singleton());
assert!(!SingleToneTest::NotSingleTon.is_singleton());
assert!(SingleToneTest::SingleTonTwo { field: false }.is_singleton());
assert!(SingleToneTest::SingleTonThird(10).is_singleton());
assert!(matches!(
MainWindowInfo.try_into().unwrap(),
SingleToneTest::Main
))
}

0 comments on commit f1939a2

Please sign in to comment.