diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-01 17:47:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-01 17:47:02 +0200 |
| commit | ff0a5f5ad79b1e2bdd76c14246ac0dd236ca5a12 (patch) | |
| tree | 0f5898c8adcb79b087ad196803633e5da6d2989f /tests/ui/parser | |
| parent | 1f881177b2897d81e3f453000985c198cb0ee583 (diff) | |
| parent | bf5910d9bb0c5cc3e4fb1a1a9ed3d73e26793c71 (diff) | |
| download | rust-ff0a5f5ad79b1e2bdd76c14246ac0dd236ca5a12.tar.gz rust-ff0a5f5ad79b1e2bdd76c14246ac0dd236ca5a12.zip | |
Rollup merge of #143210 - Kivooeo:tf19, r=tgross35
`tests/ui`: A New Order [19/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
Diffstat (limited to 'tests/ui/parser')
| -rw-r--r-- | tests/ui/parser/unicode-escape-sequences.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/parser/unicode-escape-sequences.rs b/tests/ui/parser/unicode-escape-sequences.rs new file mode 100644 index 00000000000..8b084866f19 --- /dev/null +++ b/tests/ui/parser/unicode-escape-sequences.rs @@ -0,0 +1,20 @@ +//! Test ES6-style Unicode escape sequences in string literals. +//! +//! Regression test for RFC 446 implementation. +//! See <https://github.com/rust-lang/rust/pull/19480>. + +//@ run-pass + +pub fn main() { + // Basic Unicode escape - snowman character + let s = "\u{2603}"; + assert_eq!(s, "☃"); + + let s = "\u{2a10}\u{2A01}\u{2Aa0}"; + assert_eq!(s, "⨐⨁⪠"); + + let s = "\\{20}"; + let mut correct_s = String::from("\\"); + correct_s.push_str("{20}"); + assert_eq!(s, correct_s); +} |
