2018-11-01 19:24:56 +11:00
|
|
|
#![cfg(feature = "serde")]
|
|
|
|
|
2019-05-30 11:29:54 +10:00
|
|
|
use winit::window::{CursorIcon};
|
2019-02-06 02:30:33 +11:00
|
|
|
use winit::event::{
|
2018-11-01 19:24:56 +11:00
|
|
|
KeyboardInput, TouchPhase, ElementState, MouseButton, MouseScrollDelta, VirtualKeyCode,
|
|
|
|
ModifiersState
|
|
|
|
};
|
|
|
|
use winit::dpi::{LogicalPosition, PhysicalPosition, LogicalSize, PhysicalSize};
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
2019-06-18 04:27:00 +10:00
|
|
|
#[allow(dead_code)]
|
2018-11-01 19:24:56 +11:00
|
|
|
fn needs_serde<S: Serialize + Deserialize<'static>>() {}
|
|
|
|
|
|
|
|
#[test]
|
2019-02-06 02:30:33 +11:00
|
|
|
fn window_serde() {
|
2019-05-30 11:29:54 +10:00
|
|
|
needs_serde::<CursorIcon>();
|
2018-11-01 19:24:56 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn events_serde() {
|
|
|
|
needs_serde::<KeyboardInput>();
|
|
|
|
needs_serde::<TouchPhase>();
|
|
|
|
needs_serde::<ElementState>();
|
|
|
|
needs_serde::<MouseButton>();
|
|
|
|
needs_serde::<MouseScrollDelta>();
|
|
|
|
needs_serde::<VirtualKeyCode>();
|
|
|
|
needs_serde::<ModifiersState>();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn dpi_serde() {
|
|
|
|
needs_serde::<LogicalPosition>();
|
|
|
|
needs_serde::<PhysicalPosition>();
|
|
|
|
needs_serde::<LogicalSize>();
|
|
|
|
needs_serde::<PhysicalSize>();
|
|
|
|
}
|