diff options
| author | varkor <github@varkor.com> | 2018-04-12 22:19:02 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2018-05-21 18:57:54 +0100 |
| commit | 699a2b5c7ee900c1ff99b70f9b6402ded78d3b3b (patch) | |
| tree | 78a3b129802a52f95e517988c7058fe47a6cf4da | |
| parent | 4694d20170e1a67f8a801c1f6dda11473d6fef77 (diff) | |
| download | rust-699a2b5c7ee900c1ff99b70f9b6402ded78d3b3b.tar.gz rust-699a2b5c7ee900c1ff99b70f9b6402ded78d3b3b.zip | |
Add test for Debug formatting of char
| -rw-r--r-- | src/libcore/tests/char.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcore/tests/char.rs b/src/libcore/tests/char.rs index ab90763abf8..76f28d493ab 100644 --- a/src/libcore/tests/char.rs +++ b/src/libcore/tests/char.rs @@ -187,6 +187,14 @@ fn test_escape_debug() { } #[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 { let iter: String = c.escape_default().collect(); |
