From 37653132494466312c1b85e056b7a9a4322593d3 Mon Sep 17 00:00:00 2001 From: nreed Date: Wed, 14 Jul 2021 14:52:09 -0400 Subject: [PATCH] Added raw string tests --- src/rust/rust.test.ts | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/rust/rust.test.ts b/src/rust/rust.test.ts index 51be2a86..d1015ea8 100644 --- a/src/rust/rust.test.ts +++ b/src/rust/rust.test.ts @@ -23,6 +23,44 @@ testTokenization('rust', [ ] } ], + // Raw String + [ + { + line: 'r"This is a raw string" ', + tokens: [ + { startIndex: 0, type: 'string.raw.rust' }, + { startIndex: 23, type: 'white.rust' }, + ] + } + ], + [ + { + line: 'r#"This is a raw string"# ', + tokens: [ + { startIndex: 0, type: 'string.raw.rust' }, + { startIndex: 25, type: 'white.rust' }, + ] + } + ], + [ + { + line: 'r##"This is a# raw string"## ', + tokens: [ + { startIndex: 0, type: 'string.raw.rust' }, + { startIndex: 28, type: 'white.rust' }, + ] + } + ], + [ + { + line: 'r###"This is ##"#"##a raw### string"### ', + tokens: [ + { startIndex: 0, type: 'string.raw.rust' }, + { startIndex: 39, type: 'white.rust' }, + ] + } + ], + // Byte literal [ {