From 2f327da00e4827b5f0c1b1b128f2c1db5c3af914 Mon Sep 17 00:00:00 2001 From: Simon Heimberg Date: Thu, 24 Jul 2025 10:40:34 +0200 Subject: [PATCH] test for f-string containing quotes in inner code Test for issue #22 Will fail until the issue is fixed. --- test_unify.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test_unify.py b/test_unify.py index b017fb4..599ef9d 100755 --- a/test_unify.py +++ b/test_unify.py @@ -87,6 +87,14 @@ def test_unify_quotes_should_avoid_some_cases(self): unify.unify_quotes('''f"""foo"""''', preferred_quote="'")) + self.assertEqual('''x = f'x{d["i"]}' # c''', + unify.unify_quotes('''x = f'xx{d["i"]}' # c''', + preferred_quote="'")) + + # what would be expected on: '''x = f"xx{d['i']}" # c''' + # when ' is preferred + # Change the outer and inner quotes? Keep as is? + def test_format_code(self): self.assertEqual("x = f'abc' \\\nf'next'\n", unify.format_code('x = f"abc" \\\nf"next"\n',