()
| 751 | |
| 752 | #[test] |
| 753 | fn test_parse_invalid_tstring() { |
| 754 | use InterpolatedStringErrorType::{InvalidConversionFlag, LambdaWithoutParentheses}; |
| 755 | |
| 756 | assert_eq!(parse_tstring_error(r#"t"{5!x}""#), InvalidConversionFlag); |
| 757 | assert_eq!( |
| 758 | parse_tstring_error("t'{lambda x:{x}}'"), |
| 759 | LambdaWithoutParentheses |
| 760 | ); |
| 761 | // NOTE: The parser produces the `LambdaWithoutParentheses` for this case, but |
| 762 | // since the parser only return the first error to maintain compatibility with |
| 763 | // the rest of the codebase, this test case fails. The `LambdaWithoutParentheses` |
| 764 | // error appears after the unexpected `tStringMiddle` token, which is between the |
| 765 | // `:` and the `{`. |
| 766 | // assert_eq!(parse_tstring_error("f'{lambda x: {x}}'"), LambdaWithoutParentheses); |
| 767 | assert!(parse_suite(r#"t"{class}""#).is_err()); |
| 768 | } |
| 769 | |
| 770 | #[test] |
| 771 | fn test_parse_tstring_not_equals() { |
nothing calls this directly
no outgoing calls
no test coverage detected