| 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() { |