Skip to content

Commit

Permalink
Fix weird starline-parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberiaResurrection committed Nov 3, 2024
1 parent 49a4f1f commit 091f4d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Tests/Hypothesis/Inputs/testHypothesisStarlineParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def comparison_line(draw):
'0000 000000000000000 0000000-0 [00000000000000 - - [0000] - - A 000 00?',
'0000 000000000000000 0000000-0 (00000000000000 B A A 000 0 0?)0000000000',
' 0 0000000-0 (00000000000000 - (000-0) - B A A 000 0?'
'0111 -2Z4ig11RbxW010 0000001-1 wJED9E(E(T (HN6 - (113-0) - - - B 114 00y'
'0111 -2Z4ig11RbxW010 0000001-1 wJED9E(E(T (HN6 - (113-0) - - - B 114 00y',
'0000 000000000000000 ???????-? (00000000000 )B - - A 000 ?00',
'0000 000000000000000 ???????-? (0 0000000000)A - - A 000 ?0'
]

candidate = draw(from_regex(regex=ParseStarInput.starline, alphabet='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYXZ -{}()[]?\'+*'))
Expand Down Expand Up @@ -331,6 +333,8 @@ class testHypothesisStarlineParser(unittest.TestCase):
@example('0000 000000000000000 0000000-0 [00000000000000 - - [0000] - - A 000 00?', 'weird')
@example('0000 000000000000000 0000000-0 (00000000000000 B A A 000 0 0?)0000000000', 'weird')
@example('0000 000000000000000 0000000-0 (00000000000000 - (000-0) - B A A 000 0?', 'weird')
@example('0000 000000000000000 ???????-? (00000000000 )B - - A 000 ?00', 'weird')
@example('0000 000000000000000 ???????-? (0 0000000000)A - - A 000 ?0', 'weird')
def test_starline_parser_against_regex(self, s, match):
# if it's a known weird-parse case, assume it out now
assume(match != 'weird')
Expand Down
2 changes: 1 addition & 1 deletion Tests/Hypothesis/testStar.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_star_line_extension_parsing(self, s):
self.assertTrue(foo.is_well_formed())

@given(canonical_check())
@settings(suppress_health_check=[HealthCheck(3), HealthCheck(2)], deadline=timedelta(1000))
@settings(suppress_health_check=[HealthCheck(3), HealthCheck(2)], deadline=timedelta(3000))
@example('1919 Khula ???????-? Hi In Pz Di(Khulans) {0} (000-0) [0000] BEf N A 510 10 ImDv M0 V')
def test_star_canonicalise(self, s):
hyp_line = "Hypothesis input: " + s
Expand Down

0 comments on commit 091f4d8

Please sign in to comment.