diff --git a/src/libcore/tests/char.rs b/src/libcore/tests/char.rs index ab90763abf8d5..76f28d493ab94 100644 --- a/src/libcore/tests/char.rs +++ b/src/libcore/tests/char.rs @@ -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 {