Add test for Debug formatting of char

This commit is contained in:
varkor 2018-04-12 22:19:02 +01:00
parent 4694d20170
commit 699a2b5c7e

View File

@ -186,6 +186,14 @@ fn test_escape_debug() {
assert_eq!(string('\u{100000}'), "\\u{100000}"); // private use 2
}
#[test]
fn test_debug() {
assert_eq!(format!("{:?}", 'a'), "'a'"); // ASCII character
assert_eq!(format!("{:?}", 'é'), "'é'"); // printable character
assert_eq!(format!("{:?}", '\u{301}'), "'\\u{301}'"); // combining character
assert_eq!(format!("{:?}", '\u{e000}'), "'\\u{e000}'"); // private use 1
}
#[test]
fn test_escape_default() {
fn string(c: char) -> String {