MCPcopy Create free account
hub / github.com/astral-sh/ruff / lex_fstring_missing_brace

Function lex_fstring_missing_brace

crates/ruff_python_parser/src/lexer.rs:2818–2847  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2816
2817 #[test]
2818 fn lex_fstring_missing_brace() {
2819 let source = "f'{'";
2820
2821 assert_snapshot!(lex_invalid(source, Mode::Module), @"
2822 ## Tokens
2823 ```
2824 [
2825 FStringStart 0..2 (flags = F_STRING),
2826 Lbrace 2..3,
2827 String 3..4 (flags = UNCLOSED_STRING),
2828 Newline 4..4,
2829 ]
2830 ```
2831 ## Errors
2832 ```
2833 [
2834 LexicalError {
2835 error: UnclosedStringError,
2836 location: 3..4,
2837 },
2838 LexicalError {
2839 error: FStringError(
2840 UnterminatedString,
2841 ),
2842 location: 4..4,
2843 },
2844 ]
2845 ```
2846 ");
2847 }
2848
2849 #[test]
2850 fn lex_fstring_missing_brace_after_format_spec() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected