extern crate serde; extern crate serde_json; extern crate wayland_protocol_parser; const XML: &[u8] = include_bytes!("wayland.xml"); const JSON: &[u8] = include_bytes!("wayland.json"); #[cfg(not(feature = "serde"))] compile_error!("this test requires the serde feature to be enabled"); #[test] fn core_protocol() { let mut xml = std::io::Cursor::new(XML); let protocol_xml = wayland_protocol_parser::parse(&mut xml).unwrap(); let mut json = std::io::Cursor::new(JSON); let protocol_json = serde_json::from_reader(&mut json).unwrap(); assert_eq!(protocol_xml, protocol_json); }