From 7bf8631b64ad8d6dbae9771cb4d79a54e25fed65 Mon Sep 17 00:00:00 2001 From: Marvin Serchimo <marvin.serchimo@student.reutlingen-university.de> Date: Sun, 6 Apr 2025 22:05:56 +0200 Subject: [PATCH] no test failed --- .../stringCalculator.cpython-313.pyc | Bin 0 -> 2538 bytes .../other}/AliciMuhamed/Stringcalculator | 3 + .../other}/BerishaAlma/Feature6.py | 0 .../__pycache__/Feature6.cpython-313.pyc | Bin .../other}/BerishaAlma/stringCalculator.py | 0 .../GotsisWasilios/TDD_StringCalculator.py | 0 .../stringCalculator.cpython-313.pyc | Bin .../other}/RafehDaniel/stringCalculator.py | 0 .../other}/YildirimHatice/StringCalculator.py | 0 .../StringCalculator.cpython-313.pyc | Bin .../other}/YildirimHatice/feature6.py | 0 report.md => ProjektTest/report.md | 14 +++++ .../stringCalculator.py | 0 feature7 | 58 +++++++++--------- .../__pycache__/__init__.cpython-313.pyc | Bin 171 -> 0 bytes other/__pycache__/__init__.cpython-313.pyc | Bin 158 -> 0 bytes 16 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 ProjektTest/__pycache__/stringCalculator.cpython-313.pyc rename {other => ProjektTest/other}/AliciMuhamed/Stringcalculator (97%) rename {other => ProjektTest/other}/BerishaAlma/Feature6.py (100%) rename {other => ProjektTest/other}/BerishaAlma/__pycache__/Feature6.cpython-313.pyc (100%) rename {other => ProjektTest/other}/BerishaAlma/stringCalculator.py (100%) rename {other => ProjektTest/other}/GotsisWasilios/TDD_StringCalculator.py (100%) rename {other => ProjektTest/other}/RafehDaniel/__pycache__/stringCalculator.cpython-313.pyc (100%) rename {other => ProjektTest/other}/RafehDaniel/stringCalculator.py (100%) rename {other => ProjektTest/other}/YildirimHatice/StringCalculator.py (100%) rename {other => ProjektTest/other}/YildirimHatice/__pycache__/StringCalculator.cpython-313.pyc (100%) rename {other => ProjektTest/other}/YildirimHatice/feature6.py (100%) rename report.md => ProjektTest/report.md (50%) rename stringCalculator.py => ProjektTest/stringCalculator.py (100%) delete mode 100644 other/AliciMuhamed/__pycache__/__init__.cpython-313.pyc delete mode 100644 other/__pycache__/__init__.cpython-313.pyc diff --git a/ProjektTest/__pycache__/stringCalculator.cpython-313.pyc b/ProjektTest/__pycache__/stringCalculator.cpython-313.pyc new file mode 100644 index 0000000000000000000000000000000000000000..269227fe4ae0ca3fece8068c0dc8f3ece3f43caf GIT binary patch literal 2538 zcmc&#&u<$=6rR~#+Z)HJ)5K|G2dQaN+8Q}=+{6$e1cHEC8YMs$ONd%pt(~oLvDaZ{ z4Qfvj5}_Avjg+2RacXY;2RL(WWJQUF3XnMEX2nKad2j4>Z71!ubNJ@%+c!Vn``&xg z7#a!^7{C8^T+mcP{=pA#_}W6_R}i*|K@7S~Zc;{XDomNgZ)I6!>NuGqh8iP=mZfRf z0|(Qj)(2XDR_kbeQX2rRo>kXEE!%GFSO&7XG4SqJgjgelfGuGEm?G)6YLXO`f)WoN z;dfjS>W3dKi8EG?yUfbFW!wFxvc8({Uf*$T4z$}OOBgi>Qw++~tY#=#pP^>`3!0(D z$Q{i)h6M~C(+mE1K%D*5a9PnQELo*|wPd*!cBH{hBH&cZIh%3eXSQ2qPG0Fcm4b}% zX`tygDUe;dx=VHyp>ex(o9UqCXg@hAmXjF{+a${t`@ZNTKd$7fW!rIi@_Ny|QOzYS z&Wi;HRWsL;pR>vx`&;)*o4ZMHx#wE58+V0jt*?u*6E~g(HO7G>Y?8nAPy+<Qke1c> zfY43TvC6h-ilAwhE9=z~$|2MIu4<Lqf5N7DyU4g(Dmu1PF-<0;pu#PLT6A1C410+& z)8ww@7W1a%!u4`h*XCe~=P=}zg%SK7;1+xeV2d33M(Yao4eiX=2~3aY8#pyo;*T^? z-&&3<d)UPta5OFh^s)=wYQU|}<Cgh>(}3i3_ynZ`uw2r@Q0n0l$&y^=<PjNq6=odk zz;c1!Laybwg;p)eyB5jNwScF6F&j#{y(-<#8t?lOiL0v&m4YVXnoxPQEYz~K!NyVN z;~S--%Z5O1=T9r5GWd~xuaI`Ec|HxWN&XC<I~<KX505;Uf53OHKU#UX@?^U9#%ygg zSqslS)8|?-ZY71zMqv?)AdDfLLpYCsH<5I+C`x_gPM{6}1Icme7O5+$FNMs)^mzV1 zoLXn0T@RmLFdGT@)6ZuNnhmxe=EG`5J^=%UA1XBv*F^-&qCW;lm~nY;TaXC`SMoUp z!ZvxqpI7`DQtH?j2pa^mxFTH=!F;C+>{50H{%|y%lq>){wwu`yvD5A`EB_%+90RsV zp2yy*#S-_mU&1mJJy*msl~?>4gl&=`Yn=;$qCG&{P99H#^P1Q1x|9a>(hCx=y#^X7 zrka3O2$s957=%V+GxrlLd3FVKEs8POyL~(h744dKdBeR6rH&m)Tt3y`6Ly$S{35_6 zIn+Z3`uLtcz7u(L;o*gYXkss#c(PWD&ON=juP?mTfY8(t2Aj<w^m{)dz2e|Cbja2N zAg;XJ{T@RspjY~D)S{`UseL{DI{m+=rV`hVF!@f8z_5&f`$MJeJ{NDk-2W~!Y!$Ec zK2wX%KmB4~e@A*Br!oiOaXPgR#qoYggaw2}gwvYQCH#SaU4SD4TjUs?lbK^b^`#Ns z{uf|To+%CSEi79_$28+XcusS9CS#$&QlVF!qKp2wUNCH4LPzhHEGQj$7ACpSaD%?S zDD?MQ59|Bv1F*pq<EsF5l~Vc_nf`->o0>|8cGM<;sTtI0>e>0LO#*W>G)NbB77r#8 jdlQK!fscBOXrcS}YHIXQ3;n$E<H}E;)m5U!q#yqSY_;@8 literal 0 HcmV?d00001 diff --git a/other/AliciMuhamed/Stringcalculator b/ProjektTest/other/AliciMuhamed/Stringcalculator similarity index 97% rename from other/AliciMuhamed/Stringcalculator rename to ProjektTest/other/AliciMuhamed/Stringcalculator index fc44a5a..227c1af 100644 --- a/other/AliciMuhamed/Stringcalculator +++ b/ProjektTest/other/AliciMuhamed/Stringcalculator @@ -27,6 +27,9 @@ import unittest import re +import sys +sys.path.append("/Users/marvin/Documents/GitHub/assignment-2") +from ProjektTest.stringCalculator import StringCalculator as Calc class StringCalculator: def __init__(self): diff --git a/other/BerishaAlma/Feature6.py b/ProjektTest/other/BerishaAlma/Feature6.py similarity index 100% rename from other/BerishaAlma/Feature6.py rename to ProjektTest/other/BerishaAlma/Feature6.py diff --git a/other/BerishaAlma/__pycache__/Feature6.cpython-313.pyc b/ProjektTest/other/BerishaAlma/__pycache__/Feature6.cpython-313.pyc similarity index 100% rename from other/BerishaAlma/__pycache__/Feature6.cpython-313.pyc rename to ProjektTest/other/BerishaAlma/__pycache__/Feature6.cpython-313.pyc diff --git a/other/BerishaAlma/stringCalculator.py b/ProjektTest/other/BerishaAlma/stringCalculator.py similarity index 100% rename from other/BerishaAlma/stringCalculator.py rename to ProjektTest/other/BerishaAlma/stringCalculator.py diff --git a/other/GotsisWasilios/TDD_StringCalculator.py b/ProjektTest/other/GotsisWasilios/TDD_StringCalculator.py similarity index 100% rename from other/GotsisWasilios/TDD_StringCalculator.py rename to ProjektTest/other/GotsisWasilios/TDD_StringCalculator.py diff --git a/other/RafehDaniel/__pycache__/stringCalculator.cpython-313.pyc b/ProjektTest/other/RafehDaniel/__pycache__/stringCalculator.cpython-313.pyc similarity index 100% rename from other/RafehDaniel/__pycache__/stringCalculator.cpython-313.pyc rename to ProjektTest/other/RafehDaniel/__pycache__/stringCalculator.cpython-313.pyc diff --git a/other/RafehDaniel/stringCalculator.py b/ProjektTest/other/RafehDaniel/stringCalculator.py similarity index 100% rename from other/RafehDaniel/stringCalculator.py rename to ProjektTest/other/RafehDaniel/stringCalculator.py diff --git a/other/YildirimHatice/StringCalculator.py b/ProjektTest/other/YildirimHatice/StringCalculator.py similarity index 100% rename from other/YildirimHatice/StringCalculator.py rename to ProjektTest/other/YildirimHatice/StringCalculator.py diff --git a/other/YildirimHatice/__pycache__/StringCalculator.cpython-313.pyc b/ProjektTest/other/YildirimHatice/__pycache__/StringCalculator.cpython-313.pyc similarity index 100% rename from other/YildirimHatice/__pycache__/StringCalculator.cpython-313.pyc rename to ProjektTest/other/YildirimHatice/__pycache__/StringCalculator.cpython-313.pyc diff --git a/other/YildirimHatice/feature6.py b/ProjektTest/other/YildirimHatice/feature6.py similarity index 100% rename from other/YildirimHatice/feature6.py rename to ProjektTest/other/YildirimHatice/feature6.py diff --git a/report.md b/ProjektTest/report.md similarity index 50% rename from report.md rename to ProjektTest/report.md index a4b8de5..56caa0b 100644 --- a/report.md +++ b/ProjektTest/report.md @@ -9,3 +9,17 @@ | RafehDaniel | no | 2 | | WeishauptOrlando | – | – | | YildirimHatice | – | 10 | + + + +## Eigene Implementierung gegen andere Tests + +| Name | Interface break | Failed Testcases | +|-------------------|------------------|-------------------| +| AliciMuhamed | no | 0 | +| BerishaAlma | - | - | +| GotsisWasilios | - | - | +| PikkemaatLasse | – | – | +| RafehDaniel | - | - | +| WeishauptOrlando | – | – | +| YildirimHatice | – | - | diff --git a/stringCalculator.py b/ProjektTest/stringCalculator.py similarity index 100% rename from stringCalculator.py rename to ProjektTest/stringCalculator.py diff --git a/feature7 b/feature7 index e8d1959..e8ed4b2 100644 --- a/feature7 +++ b/feature7 @@ -1,54 +1,54 @@ import re import unittest -from other.YildirimHatice.StringCalculator import StringCalculator as Hatice -#class StringCalculator: - # def add(self, numbers: str) -> int: - # Feature 1: Leerer String ergibt 0 - #if not numbers: - # return 0 + +class StringCalculator: + def add(self, numbers: str) -> int: + #Feature 1: Leerer String ergibt 0 + if not numbers: + return 0 # Vorbereitung für weiter features - #delimiters = [",", "\n"] - #if numbers.startswith("//"): - # delimiter_end_index = numbers.index("\n") - # delimiter_section = numbers[2:delimiter_end_index] - # numbers = numbers[delimiter_end_index + 1:] + delimiters = [",", "\n"] + if numbers.startswith("//"): + delimiter_end_index = numbers.index("\n") + delimiter_section = numbers[2:delimiter_end_index] + numbers = numbers[delimiter_end_index + 1:] # Feature 7: Delimiter beliebiger Länge im Format //[***] - #if delimiter_section.startswith("[") and delimiter_section.endswith("]"): - # delimiter = re.escape(delimiter_section[1:-1]) - #else: - # delimiter = re.escape(delimiter_section) + if delimiter_section.startswith("[") and delimiter_section.endswith("]"): + delimiter = re.escape(delimiter_section[1:-1]) + else: + delimiter = re.escape(delimiter_section) - #delimiters.append(delimiter) + delimiters.append(delimiter) # Feature 3: Erlaube Zeilenumbrüche als Trenner - #split_pattern = "|".join(delimiters) - #number_list = re.split(split_pattern, numbers) + split_pattern = "|".join(delimiters) + number_list = re.split(split_pattern, numbers) # Feature 4: Negativzahlen abfangen - #negatives = [] - #for num in number_list: - # if num.strip() != "": - # value = int(num) - # if value < 0: - # negatives.append(value) + negatives = [] + for num in number_list: + if num.strip() != "": + value = int(num) + if value < 0: + negatives.append(value) # Exception bei negativen Zahlen - #if negatives: - # raise ValueError(f"Negative numbers are not allowed: {', '.join(map(str, negatives))}") + if negatives: + raise ValueError(f"Negative numbers are not allowed: {', '.join(map(str, negatives))}") - # Feature 2: Beliebig viele Zahlen summieren - #return sum(int(n) for n in number_list if n.strip() != "" and int(n) <= 1000) + #Feature 2: Beliebig viele Zahlen summieren + return sum(int(n) for n in number_list if n.strip() != "" and int(n) <= 1000) @@ -57,7 +57,7 @@ class TestStringCalculator(unittest.TestCase): def setUp(self): """neue Instanz des StringCalculators vor jedem Test""" - self.calculator = Hatice() + self.calculator = StringCalculator() def test_empty_string_returns_zero(self): """Feature 1: Leerer String soll 0 ergeben""" diff --git a/other/AliciMuhamed/__pycache__/__init__.cpython-313.pyc b/other/AliciMuhamed/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index f59d9aef39912fbf3c48c517faee693e27ca18af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmey&%ge<81a~idN(a%8K?DpiLK&Y~fQ+dO=?t2Tek&P@n1H;`AgNnk`k}?CMaBBL ziA80ZdHOE-$)&lec_qdA?wKVXrAhjU#l@NFc_1NOBmMl6jMO51$DGXMOyAOs#N5;r s{rLFIyv&mLc)fzkTO2mI`6;D2sdh!IK%+rc7lRldnHd=wi<p5d03_fnj{pDw diff --git a/other/__pycache__/__init__.cpython-313.pyc b/other/__pycache__/__init__.cpython-313.pyc deleted file mode 100644 index 2f81337b3f670f5b88bbb598ac7352a7f961b3d1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 158 zcmey&%ge<81a~idN(a%8K?DpiLK&Y~fQ+dO=?t2Tek&P@n1H;`AgNon`k}?CMaBBL ziA80ZdHOE-$)&lec_qdA?wKVXrAhjU#l@NFc_1NOBmMl6jMO6i`1s7c%#!$cy@JYH f95%W6DWy57c15f}(?GTrgBTx~85tRin1L(+sMsg4 -- GitLab