Skip to content

Commit 699a2b5

Browse files
committed
Add test for Debug formatting of char
1 parent 4694d20 commit 699a2b5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libcore/tests/char.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ fn test_escape_debug() {
186186
assert_eq!(string('\u{100000}'), "\\u{100000}"); // private use 2
187187
}
188188

189+
#[test]
190+
fn test_debug() {
191+
assert_eq!(format!("{:?}", 'a'), "'a'"); // ASCII character
192+
assert_eq!(format!("{:?}", 'é'), "'é'"); // printable character
193+
assert_eq!(format!("{:?}", '\u{301}'), "'\\u{301}'"); // combining character
194+
assert_eq!(format!("{:?}", '\u{e000}'), "'\\u{e000}'"); // private use 1
195+
}
196+
189197
#[test]
190198
fn test_escape_default() {
191199
fn string(c: char) -> String {

0 commit comments

Comments
 (0)