Another project
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 842 B View raw
1use bone_ui::Theme; 2 3#[test] 4fn light_theme_default_snapshot() { 5 insta::assert_ron_snapshot!("theme_light", Theme::light()); 6} 7 8#[test] 9fn dark_theme_default_snapshot() { 10 insta::assert_ron_snapshot!("theme_dark", Theme::dark()); 11} 12 13#[test] 14fn round_trip_light_through_ron_is_stable() { 15 assert_round_trip_stable(&Theme::light()); 16} 17 18#[test] 19fn round_trip_dark_through_ron_is_stable() { 20 assert_round_trip_stable(&Theme::dark()); 21} 22 23fn assert_round_trip_stable(theme: &Theme) { 24 let Ok(first) = ron::ser::to_string(theme) else { 25 panic!("first serialize failed"); 26 }; 27 let Ok(parsed) = ron::de::from_str::<Theme>(&first) else { 28 panic!("deserialize failed"); 29 }; 30 let Ok(second) = ron::ser::to_string(&parsed) else { 31 panic!("second serialize failed"); 32 }; 33 assert_eq!(first, second); 34}