Skip to content

Commit

Permalink
Add test for Debug formatting of char
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed May 21, 2018
1 parent 4694d20 commit 699a2b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libcore/tests/char.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit 699a2b5

Please sign in to comment.