diff options
Diffstat (limited to 'python/problems/lists_and_if-fkkt/min_and_max/common.py')
-rw-r--r-- | python/problems/lists_and_if-fkkt/min_and_max/common.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/problems/lists_and_if-fkkt/min_and_max/common.py b/python/problems/lists_and_if-fkkt/min_and_max/common.py index 2b1d0b3..7e0da9c 100644 --- a/python/problems/lists_and_if-fkkt/min_and_max/common.py +++ b/python/problems/lists_and_if-fkkt/min_and_max/common.py @@ -41,12 +41,14 @@ def test(python, code, aux_code=''): test_in = [ (None, '5\n8\n7\n'), (None, '4\n3\n2\n'), - (None, '1\n0\n2\n') + (None, '1\n0\n2\n'), + (None, '1\n1\n1\n') ] test_out = [ 'Minimum: 5 , Maksimum: 8', 'Minimum: 2 , Maksimum: 4', - 'Minimum: 0 , Maksimum: 2' + 'Minimum: 0 , Maksimum: 2', + 'Minimum: 1 , Maksimum: 1' ] # List of outputs: (expression result, stdout, stderr, exception). @@ -56,7 +58,8 @@ def test(python, code, aux_code=''): n_correct = 0 tin = None for i, (output, correct) in enumerate(zip(outputs, test_out)): - if re.sub('\s', '', output).endswith(re.sub('\s', '', correct)): + if re.sub('\s', '', output).endswith(re.sub('\s', '', correct)) and \ + not re.sub('\s', '', output).endswith(re.sub('\s', '', correct)*2): n_correct += 1 else: tin = test_in[i][1] |