Skip to content

Commit

Permalink
fix[test]: fix test in grammar fuzzer (#4150)
Browse files Browse the repository at this point in the history
hypothesis `6.103.1` generates examples like

```
Falsifying example: test_grammar_bruteforce(
    code='"""\r""" \n""""""',
)
```

which trivially raise an exception in asttokens. filter out `\r`
characters when generating source codes.
  • Loading branch information
charles-cooper authored Jul 26, 2024
1 parent fc19284 commit 6a8d415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/functional/grammar/test_grammar.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_basic_grammar_empty():

def fix_terminal(terminal: str) -> str:
# these throw exceptions in the grammar
for bad in ("\x00", "\\ ", "\x0c"):
for bad in ("\x00", "\\ ", "\x0c", "\x0d"):
terminal = terminal.replace(bad, " ")
return terminal

Expand Down

0 comments on commit 6a8d415

Please sign in to comment.