Skip to content

Commit

Permalink
tests: Strip before garbage check in test_parser_noncontiguous_leading
Browse files Browse the repository at this point in the history
Hypothesis brought up the following example:

    @example(subs=[srt.Subtitle(index=0, start=timedelta(0), end=timedelta(days=21186, seconds=33261), content='0', proprietary='')],
        garbage='\x1f0',
    )

This is a bit confusing, the real characters are "\x1f" and "0". Since
we will strip inside due to using \s* in the regex, this just appears as
"0" to the parser.
  • Loading branch information
cdown committed Aug 14, 2020
1 parent ca937b8 commit 84ccccd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_srt.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ def test_parser_noncontiguous_leading(subs, garbage):
# index...
assume(garbage.strip()[0] != ".")
assume(garbage.strip()[0] != "-")
assume(not _parseable_as_int(garbage))
assume(not _parseable_as_float(garbage))
assume(not _parseable_as_int(garbage.strip()))
assume(not _parseable_as_float(garbage.strip()))

# Put some garbage at the beginning that should trigger our noncontiguity
# checks
Expand Down

0 comments on commit 84ccccd

Please sign in to comment.