use kanji::*; use serde::{Deserialize, Serialize}; #[test] fn serde_instances() { round_trip::("\"合\""); round_trip::("\"あ\""); round_trip::("\"ア\""); round_trip::("\"。\""); round_trip::("\"A\""); round_trip::("\"a\""); round_trip::("\"魚\""); } fn round_trip<'a, T>(s: &'a str) where T: Serialize + Deserialize<'a>, { let from = serde_json::from_str::(s).unwrap(); let to = serde_json::to_string(&from).unwrap(); assert_eq!(s, to); }