diff options
Diffstat (limited to 'tools/snippets_translate')
| -rw-r--r-- | tools/snippets_translate/handlers.py | 2 | ||||
| -rw-r--r-- | tools/snippets_translate/tests/test_converter.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/snippets_translate/handlers.py b/tools/snippets_translate/handlers.py index 7941dc9ed..10bc9d00e 100644 --- a/tools/snippets_translate/handlers.py +++ b/tools/snippets_translate/handlers.py @@ -87,7 +87,7 @@ def handle_inc_dec(x, operator): clean_x = x.strip() if clean_x.startswith(operator) or clean_x.endswith(operator): x = x.replace(operator, "") - x = f"{x} = {clean_x.replace(operator, '')} {operator[0]} 1" + x = f"{x} {operator[0]}= 1" return x diff --git a/tools/snippets_translate/tests/test_converter.py b/tools/snippets_translate/tests/test_converter.py index 70026b8d2..beab3ad09 100644 --- a/tools/snippets_translate/tests/test_converter.py +++ b/tools/snippets_translate/tests/test_converter.py @@ -36,8 +36,8 @@ def test_curly_braces(): def test_inc_dec(): - assert st("++i;") == "i = i + 1" - assert st("i--;") == "i = i - 1" + assert st("++i;") == "i += 1" + assert st("i--;") == "i -= 1" def test_and_or(): |
