about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-21 00:04:04 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-21 09:26:44 -0800
commit1d34d93d117ef97f4034f06c62020bc1c919b175 (patch)
tree717e439094ab4208fb27c4c7d8598f9b55d8921f
parent319ed81307ab68c58c7fd446cac4454e3a1ff8e9 (diff)
parent0e9b12b9cc7d2b005c07b12313c6008ba667d3d6 (diff)
downloadrust-1d34d93d117ef97f4034f06c62020bc1c919b175.tar.gz
rust-1d34d93d117ef97f4034f06c62020bc1c919b175.zip
rollup merge of #19977: pnkfelix/add-test-for-issue-19811
Add regression test for Issue 19811.

(Thanks for @emk for providing this.)

Fix #19811.
-rw-r--r--src/test/run-pass/issue-19811-escape-unicode.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-19811-escape-unicode.rs b/src/test/run-pass/issue-19811-escape-unicode.rs
new file mode 100644
index 00000000000..23400859e54
--- /dev/null
+++ b/src/test/run-pass/issue-19811-escape-unicode.rs
@@ -0,0 +1,17 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let mut escaped = String::from_str("");
+    for c in '\u{10401}'.escape_unicode() {
+        escaped.push(c);
+    }
+    assert_eq!("\\u{10401}", escaped);
+}