From 666ff4bfdc7a674e7a7498a17c3ebd20f3e25daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Pober=C5=BEnik?= Date: Tue, 24 Oct 2017 16:11:29 +0200 Subject: Add test cases and fix grammer --- python/problems/lists_and_if-fkkt/itm/common.py | 4 ++-- python/problems/lists_and_if-fkkt/min_and_max/common.py | 9 ++++++--- python/problems/lists_and_if-fkkt/min_and_max/sl.py | 2 +- python/problems/lists_and_if-fkkt/sl.py | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) (limited to 'python/problems') diff --git a/python/problems/lists_and_if-fkkt/itm/common.py b/python/problems/lists_and_if-fkkt/itm/common.py index f8ae83a..4778176 100644 --- a/python/problems/lists_and_if-fkkt/itm/common.py +++ b/python/problems/lists_and_if-fkkt/itm/common.py @@ -17,7 +17,7 @@ if indeks > 25: elif indeks < 18.5: print("Pojejte kakšen kos torte več! ;)") else: - print("Super, nadaljujte s svojim življenskim stilom!") + print("Super, nadaljujte s svojim življenjskim stilom!") ''' hint_type = { @@ -37,7 +37,7 @@ def test(python, code, aux_code=''): ] test_out = [ - 'Vaš indeks telesne mase je: 19.6\nSuper, nadaljujte s svojim življenskim stilom!', + 'Vaš indeks telesne mase je: 19.6\nSuper, nadaljujte s svojim življenjskim stilom!', 'Vaš indeks telesne mase je: 25.71\nPotrebno se bo več gibati in jesti bolj zdravo!', 'Vaš indeks telesne mase je: 18.34\nPojejte kakšen kos torte več! ;)' ] 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] diff --git a/python/problems/lists_and_if-fkkt/min_and_max/sl.py b/python/problems/lists_and_if-fkkt/min_and_max/sl.py index 581dd5e..401f90c 100644 --- a/python/problems/lists_and_if-fkkt/min_and_max/sl.py +++ b/python/problems/lists_and_if-fkkt/min_and_max/sl.py @@ -7,7 +7,7 @@ slug = 'Največje in najmanjše število' description = '''\ -

Izpišite največjo in najmanjšo izmed treh števil, ki jih vnese uporabnik. Ne uporabite funkcij min() in max().
+

Izpišite največje in najmanjše izmed treh števil, ki jih vnese uporabnik. Ne uporabite funkcij min() in max().
Primer uporabe:

Vpišite 1. število: 5
diff --git a/python/problems/lists_and_if-fkkt/sl.py b/python/problems/lists_and_if-fkkt/sl.py
index 493d9a7..807a1c6 100644
--- a/python/problems/lists_and_if-fkkt/sl.py
+++ b/python/problems/lists_and_if-fkkt/sl.py
@@ -1,3 +1,3 @@
-name = 'Pogojni stavki in seznami'
+name = 'Pogojni stavki in seznami - FKKT'
 description = 'Naloge s seznami in pogojnimi stavki'
 
-- 
cgit v1.2.1