GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-94808: Coverage: Test uppercase string literal prefixes by mdboom · Pull Request #95925 · python/cpython Conversation
|
| self.assertEqual(eval(r""" R'\x01' """), '\\x01') | ||
| self.assertEqual(eval(r""" BR'\x01' """), b'\\' + b'x01') | ||
| self.assertEqual(eval(""" F'{1+1}' """), '2') | ||
| self.assertEqual(eval(""" U'\U0001d120' """), '\U0001d120') |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Presumably the lowercase versions are covered by other tests (right?)
Would it be simpler here to just assert in each case that the lowercase and upper case prefixes generate the same thing? For instance, self.assertEqual(eval(""" F'{1+1}' """), eval(""" f'{1+1}' """)).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. Updated.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
IIUC this is covering the uppercase cases here: http://droettboom.com/cpython-coverage/llvm-coverage/coverage/home/mdboom/Work/builds/cpython/Parser/string_parser.c.html#L183 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| self.assertEqual(eval(r""" R'\x01' """), r'\x01') | ||
| self.assertEqual(eval(r""" BR'\x01' """), br'\x01') | ||
| self.assertEqual(eval(""" F'{1+1}' """), f'{1+1}') | ||
| self.assertEqual(eval(""" U'\U0001d120' """), u'\U0001d120') |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actually do we need the eval() calls?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @mdboom for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-97518 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…honGH-95925) (cherry picked from commit f00383e) Co-authored-by: Michael Droettboom <[email protected]>
(cherry picked from commit f00383e) Co-authored-by: Michael Droettboom <[email protected]>
|
Thanks @mdboom for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-97537 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…honGH-95925) (cherry picked from commit f00383e) Co-authored-by: Michael Droettboom <[email protected]>
(cherry picked from commit f00383e) Co-authored-by: Michael Droettboom <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.