From 32c600664e5a599bbe3f0254274211474b89914a Mon Sep 17 00:00:00 2001 From: Jade Date: Wed, 12 May 2021 21:22:13 -0700 Subject: Test lowering byte strings some more --- crates/hir_ty/src/tests/simple.rs | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'crates') diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs index 79445a12d..1032f09ac 100644 --- a/crates/hir_ty/src/tests/simple.rs +++ b/crates/hir_ty/src/tests/simple.rs @@ -488,23 +488,34 @@ fn infer_literals() { mod foo {} "#; br#"yolo"#; + let a = b"a\x20b\ + c"; + let b = br"g\ +h"; + let c = br#"x"\"yb"#; } "##, expect![[r##" - 10..216 '{ ...o"#; }': () - 16..20 '5i32': i32 - 26..30 '5f32': f32 - 36..40 '5f64': f64 - 46..53 '"hello"': &str - 59..67 'b"bytes"': &[u8; 5] - 73..76 ''c'': char - 82..86 'b'b'': u8 - 92..96 '3.14': f64 - 102..106 '5000': i32 - 112..117 'false': bool - 123..127 'true': bool - 133..197 'r#" ... "#': &str - 203..213 'br#"yolo"#': &[u8; 4] + 18..478 '{ ... }': () + 32..36 '5i32': i32 + 50..54 '5f32': f32 + 68..72 '5f64': f64 + 86..93 '"hello"': &str + 107..115 'b"bytes"': &[u8; 5] + 129..132 ''c'': char + 146..150 'b'b'': u8 + 164..168 '3.14': f64 + 182..186 '5000': i32 + 200..205 'false': bool + 219..223 'true': bool + 237..333 'r#" ... "#': &str + 347..357 'br#"yolo"#': &[u8; 4] + 375..376 'a': &[u8; 4] + 379..403 'b"a\x2... c"': &[u8; 4] + 421..422 'b': &[u8; 4] + 425..433 'br"g\ h"': &[u8; 4] + 451..452 'c': &[u8; 6] + 455..467 'br#"x"\"yb"#': &[u8; 6] "##]], ); } -- cgit v1.2.3