black/tests/data/preview
Yilei "Dolee" Yang 96e62c57e3
Fix a crash in preview style with assert + parenthesized string. (#3415)
The bug is in the `get_leaves_inside_matching_brackets` on the third line below:

```python
assert xxxxxxxxx.xxxxxxxxx.xxxxxxxxx(
    xxxxxxxxx
).xxxxxxxxxxxxxxxxxx(), (
    "xxx {xxxxxxxxx} xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
)
```

Including the invisible paren, third line is `).xxxxxxxxxxxxxxxxxx()), (`, that it has a matched pair then an unmatched closing paren afterwards. This PR ensures the returned leaves are actually matched.

Fixes #3414.
2022-12-10 07:58:45 -08:00
..
cantfit.py Wrap concatenated strings used as function args in parens (#3307) 2022-10-26 18:03:10 -07:00
comments7.py Add parens around implicit string concatenations where it increases readability (#3162) 2022-08-30 22:52:00 -04:00
comments8.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
comments9.py Enforce empty lines before classes/functions with sticky leading comments. (#3302) 2022-10-25 18:03:24 -07:00
docstring_preview.py Don't (ever) put a single-char closing docstring quote on a new line (#3166) 2022-07-13 22:26:05 -04:00
long_strings__edge_case.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
long_strings__regression.py Wrap concatenated strings used as function args in parens (#3307) 2022-10-26 18:03:10 -07:00
long_strings.py Wrap concatenated strings used as function args in parens (#3307) 2022-10-26 18:03:10 -07:00
one_element_subscript.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
percent_precedence.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
remove_await_parens.py Enforce empty lines before classes/functions with sticky leading comments. (#3302) 2022-10-25 18:03:24 -07:00
remove_except_parens.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
remove_for_brackets.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
remove_newline_after_code_block_open.py Remove newline after code block open (#3035) 2022-06-11 09:55:01 +03:00
return_annotation_brackets.py Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
skip_magic_trailing_comma.py Correctly handle trailing commas that are inside a line's leading non-nested parens (#3370) 2022-11-09 15:08:51 -08:00
trailing_commas_in_leading_parts.py Fix a crash in preview style with assert + parenthesized string. (#3415) 2022-12-10 07:58:45 -08:00
whitespace.py Remove whitespaces of whitespace-only files (#3348) 2022-11-11 20:05:36 -05:00