Skip to content

Commit 6416381

Browse files
committed
add test for negative fraction input in fuel.py
1 parent 627a961 commit 6416381

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fuel/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def test_no_slash():
106106
check50.run("python3 fuel.py").stdin(input, prompt=True).reject()
107107

108108

109+
@check50.check(exists)
110+
def test_negative_fraction():
111+
"""input of -1/4 results in reprompt"""
112+
input = "-1/4"
113+
check50.run("python3 fuel.py").stdin(input, prompt=True).reject()
114+
115+
109116
def regex(percent):
110117
"""match case-insensitively with only whitespace on either side"""
111118
return fr'(?i)^\s*{escape(percent)}\s*$'

0 commit comments

Comments
 (0)