Parcourir la source

Added raw string tests

nreed il y a 4 ans
Parent
commit
3765313249
1 fichiers modifiés avec 38 ajouts et 0 suppressions
  1. 38 0
      src/rust/rust.test.ts

+ 38 - 0
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
 	[
 		{