---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/join_implicit_concatenated_string_preserve.py
---
## Input
```python
a = "different '" 'quote "are fine"'  # join

# More single quotes
"one single'" "two 'single'" ' two "double"'

# More double quotes
'one double"' 'two "double"' " two 'single'"

# Equal number of single and double quotes
'two "double"' " two 'single'"

# Already invalid Pre Python 312
f"{'Hy "User"'}" f'{"Hy 'User'"}'


# Regression tests for https://github.com/astral-sh/ruff/issues/15514
params = {}
string = "this is my string with " f'"{params.get("mine")}"'
string = f'"{params.get("mine")} ' f"with {'nested single quoted string'}"
string = f"{'''inner ' '''}" f'{"""inner " """}'
string = f"{10 + len('bar')=}" f"{10 + len('bar')=}"
string = f"{10 + len('bar')=}" f'{10 + len("bar")=}'
```

## Outputs
### Output 1
```
indent-style               = space
line-width                 = 88
indent-width               = 4
quote-style                = Preserve
line-ending                = LineFeed
magic-trailing-comma       = Respect
docstring-code             = Disabled
docstring-code-line-width  = "dynamic"
preview                    = Disabled
target_version             = 3.9
source_type                = Python
```

```python
a = "different 'quote \"are fine\""  # join

# More single quotes
"one single'two 'single' two \"double\""

# More double quotes
'one double"two "double" two \'single\''

# Equal number of single and double quotes
'two "double" two \'single\''

# Already invalid Pre Python 312
f"{'Hy "User"'}{"Hy 'User'"}"


# Regression tests for https://github.com/astral-sh/ruff/issues/15514
params = {}
string = f"this is my string with \"{params.get('mine')}\""
string = f'"{params.get("mine")} with {"nested single quoted string"}'
string = f"{'''inner ' '''}" f'{"""inner " """}'
string = f"{10 + len('bar')=}{10 + len('bar')=}"
string = f"{10 + len('bar')=}" f'{10 + len("bar")=}'
```


### Output 2
```
indent-style               = space
line-width                 = 88
indent-width               = 4
quote-style                = Preserve
line-ending                = LineFeed
magic-trailing-comma       = Respect
docstring-code             = Disabled
docstring-code-line-width  = "dynamic"
preview                    = Disabled
target_version             = 3.12
source_type                = Python
```

```python
a = "different 'quote \"are fine\""  # join

# More single quotes
"one single'two 'single' two \"double\""

# More double quotes
'one double"two "double" two \'single\''

# Equal number of single and double quotes
'two "double" two \'single\''

# Already invalid Pre Python 312
f"{'Hy "User"'}{"Hy 'User'"}"


# Regression tests for https://github.com/astral-sh/ruff/issues/15514
params = {}
string = f"this is my string with \"{params.get("mine")}\""
string = f'"{params.get("mine")} with {'nested single quoted string'}'
string = f"{'''inner ' '''}{"""inner " """}"
string = f"{10 + len('bar')=}{10 + len('bar')=}"
string = f"{10 + len('bar')=}{10 + len("bar")=}"
```
