Skip to content

Commit 2988243

Browse files
committed
Fixed isdigit() function to ignore whitespace
1 parent 030d8b5 commit 2988243

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/test_all_solutions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,8 @@ def test_all_solutions(directory_name, compiler_name, expected_solutions):
102102
try:
103103
with open("expected_solutions.txt", "r") as expected_solutions_file:
104104
for line in expected_solutions_file:
105-
line = line[:-1] # Remove trailing newlines
106105
key_value_pair = line.split(" ")
107-
if len(key_value_pair) == 2 and key_value_pair[1].isdigit(): # Extract all expected solutions; ignore bad entries
106+
if len(key_value_pair) == 2 and key_value_pair[1].strip().isdigit(): # Extract all expected solutions; ignore bad entries
108107
print("Got here")
109108
expected_solutions[key_value_pair[0]] = int(key_value_pair[1])
110109
except IOError:

0 commit comments

Comments
 (0)