MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / test_fstring_with_newlines

Function test_fstring_with_newlines

aiscript-lexer/src/fstring_tests.rs:119–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117
118 #[test]
119 fn test_fstring_with_newlines() {
120 let source = "f\"Line 1\nLine 2 {variable}\nLine 3\"";
121 let mut scanner = Lexer::new(source);
122
123 let token = scanner.next().unwrap();
124 assert_eq!(token.kind, TokenType::FString);
125 assert_eq!(token.lexeme, "Line 1\nLine 2 {variable}\nLine 3");
126 // Line number is 3 because the token ends on the third line
127 // and the lexer tracks the current line
128 assert_eq!(token.line, 3);
129 }
130
131 #[test]
132 fn test_escaped_braces_in_fstring() {

Callers

nothing calls this directly

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected