vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.81k stars 788 forks source link

fix[test]: fix test in grammar fuzzer #4150

Open charles-cooper opened 3 weeks ago

charles-cooper commented 3 weeks ago

What I did

fix a failing test run in https://github.com/vyperlang/vyper/actions/runs/9503241643/job/26193257852 (copy paste of the error below):

=========================== short test summary info ============================
FAILED tests/functional/grammar/test_grammar.py::test_grammar_bruteforce - IndexError: list index out of range
Falsifying example: test_grammar_bruteforce(
    code='"""\r""" \n""""""',
)

You can reproduce this example by temporarily adding @reproduce_failure('6.103.1', b'AXicY+RnYGD0BWJGRgY4AAAGWwBi') as a decorator on your test case
============ 1 failed, 734 passed, 8 warnings in 192.85s (0:03:12) =============
Error: Process completed with exit code 1.

How I did it

How to verify it

Commit message

hypothesis `6.103.1` generates examples like

``` code='"""\r"""
\n""""""'

which trivially raise an exception in asttokens. filter out \r characters when generating source codes.



### Description for the changelog

### Cute Animal Picture

![Put a link to a cute animal picture inside the parenthesis-->]()