Update fstring from v3.12.7#5444
Conversation
youknowone
left a comment
There was a problem hiding this comment.
Thank you for contributing. Updating test_fstring seems a big task.
Please check the comment and other commented out test codes too to fit failing tests to our preference.
| self.assertEqual(t.body[1].value.values[0].lineno, 3) | ||
| self.assertEqual(t.body[1].value.values[1].lineno, 3) | ||
| self.assertEqual(t.body[1].value.values[2].lineno, 3) | ||
| # TODO: RUSTPYTHON self.assertEqual(t.body[1].value.values[1].lineno, 4) |
There was a problem hiding this comment.
we usually do not comment out test lines, but turn off the test itself.
Could you revert this part and mark test_ast_line_numbers_multiline_fstring as expectedFailure?
add expectedFailure to tag what should rustpython do add comment for some syntaxerror which make test run broken
164bf6e to
40a9dda
Compare
key262yek
left a comment
There was a problem hiding this comment.
I still struggle with rebase..
I made new branch with same name.
I remove comment from test, but some lines cannot be un-commented because of SyntaxError.
| # TODO: RUSTPYTHON SyntaxError | ||
| # self.assertEqual(f'{' f'}', " f") |
There was a problem hiding this comment.
I can't remove some comments, because it makes SyntaxError before test runs (so it cannot be passed by expectedFailure)
There was a problem hiding this comment.
Ah, that makes sense. Thank you
| # TODO: RUSTPYTHON SyntaxError | ||
| # self.assertEqual( | ||
| # f""" | ||
| # # this is not a comment | ||
| # { # the following operation it's | ||
| # 3 # this is a number | ||
| # * 2}""", | ||
| # "\n# this is not a comment\n6", | ||
| # ) |
| # TODO: RUSTPYTHON SyntaxError | ||
| # self.assertEqual( | ||
| # f"result: {value:{width:{0}}.{precision:1}}", "result: 12.35" | ||
| # ) |
| # TODO: RUSTPYTHON SyntaxError | ||
| # self.assertEqual( | ||
| # f"{( | ||
| # 1 + | ||
| # 2 | ||
| # )}", | ||
| # "3", | ||
| # ) |
| # TODO: RUSTPYTHON SyntaxError | ||
| # def test_expressions_with_triple_quoted_strings(self): | ||
| # self.assertEqual(f"{'''x'''}", 'x') | ||
| # self.assertEqual(f"{'''eric's'''}", "eric's") | ||
|
|
||
| # Test concatenation within an expression | ||
| # TODO: RUSTPYTHON self.assertEqual(f'{"x" """eric"s""" "y"}', 'xeric"sy') | ||
| # TODO: RUSTPYTHON self.assertEqual(f'{"x" """eric"s"""}', 'xeric"s') | ||
| # TODO: RUSTPYTHON self.assertEqual(f'{"""eric"s""" "y"}', 'eric"sy') | ||
| # TODO: RUSTPYTHON self.assertEqual(f'{"""x""" """eric"s""" "y"}', 'xeric"sy') | ||
| # TODO: RUSTPYTHON self.assertEqual(f'{"""x""" """eric"s""" """y"""}', 'xeric"sy') | ||
| # TODO: RUSTPYTHON self.assertEqual(f'{r"""x""" """eric"s""" """y"""}', 'xeric"sy') | ||
| # # Test concatenation within an expression | ||
| # self.assertEqual(f'{"x" """eric"s""" "y"}', 'xeric"sy') | ||
| # self.assertEqual(f'{"x" """eric"s"""}', 'xeric"s') | ||
| # self.assertEqual(f'{"""eric"s""" "y"}', 'eric"sy') | ||
| # self.assertEqual(f'{"""x""" """eric"s""" "y"}', 'xeric"sy') | ||
| # self.assertEqual(f'{"""x""" """eric"s""" """y"""}', 'xeric"sy') | ||
| # self.assertEqual(f'{r"""x""" """eric"s""" """y"""}', 'xeric"sy') |
There was a problem hiding this comment.
I think this part is the reason why I commented line by line of broken assertion at first.
Only one assertion can be run, and others make SyntaxError
youknowone
left a comment
There was a problem hiding this comment.
Lets go with it. We can fix it once parser is changed
Update test_fstring.py from CPython v3.12.7