// option. This file may not be copied, modified, or distributed
// except according to those terms.
+use crate::test::TestFn;
use idna::punycode::{decode, encode_str};
-use serde_json::Value;
use serde_json::map::Map;
+use serde_json::Value;
use std::str::FromStr;
-use test::TestFn;
fn one_test(decoded: &str, encoded: &str) {
match decode(encoded) {
let result = result.into_iter().collect::<String>();
assert!(
result == decoded,
- format!(
- "Incorrect decoding of \"{}\":\n \"{}\"\n!= \"{}\"\n",
- encoded, result, decoded
- )
+ "Incorrect decoding of \"{}\":\n \"{}\"\n!= \"{}\"\n",
+ encoded,
+ result,
+ decoded
)
}
}
None => panic!("Encoding {} failed.", decoded),
Some(result) => assert!(
result == encoded,
- format!(
- "Incorrect encoding of \"{}\":\n \"{}\"\n!= \"{}\"\n",
- decoded, result, encoded
- )
+ "Incorrect encoding of \"{}\":\n \"{}\"\n!= \"{}\"\n",
+ decoded,
+ result,
+ encoded
),
}
}