From 64e82a191eeb791f9a25d3d211969b7a73dd6f4b Mon Sep 17 00:00:00 2001 From: Sanjar Ahmadov Date: Tue, 23 Mar 2021 21:56:53 -0400 Subject: [PATCH] Added all the test cases from PA1 for good.py for validation purposes. --- src/test/data/pa2/student_contributed/good.py | 85 ++++++++++++++++++- 1 file changed, 83 insertions(+), 2 deletions(-) diff --git a/src/test/data/pa2/student_contributed/good.py b/src/test/data/pa2/student_contributed/good.py index a036d62..c16c124 100644 --- a/src/test/data/pa2/student_contributed/good.py +++ b/src/test/data/pa2/student_contributed/good.py @@ -1,2 +1,83 @@ -x:int = 1 -x * 1 +# Below this point we have all the same test cases from PA1 for validation purposes. +class Foo(object): + x:int = 0 + + def __init__(self:"Foo", x:int): + self.x = x + + def bar(y:int): + print("Hello World!",self.x+y) + y = 10 + +def get_stones(name:str)->str: + def map_name(nm:str)->str: + return stones[color.index(nm)] + color=["Red","Blue"] + stones=["Mind","Soul"] + return map_name(name) + +def funa(): + def funb(): + print("Hello") + funb() + +def fund(): + def fune(): + print("Hello") + c = 4 + 5 + +def funf(): + def fung(): + print("Hello") + c = 6 + c = 4 + 5 + + +if True: + if True: + if True: + print("Hello") +print("World") + +if True: + if True: + if True: + print("Hello") + print("World") + +if True: + if True: + if True: + print("Hello") + print("World") + +if True: + if True: + if True: + print("Hello") + else: + print("World") + +if True: + if True: + if True: + print("Hello") +else: + print("World") + + + +f = Foo(1) +print(f.x) +f.bar(4) + +a=[[[1],[2]],[[3],[4]]] +print(a[0][0][1]*a[1][1][0]) + +multiline_string="Hi World,\ +Here I am" + +expr_precedence = -a + b * (c + d) + +stone="Blue" +print(get_stones(stone))