on master help sign in
Update battest.py
f464b1bSarvesh MD
tests/syntax-tests/highlighted/Python/battest.py+12−7
@@ -8,7 +8,7 @@
8h2 = 4 # this is a comment
8h2 = 4 # this is a comment
9"""this is also a comment"""
9"""this is also a comment"""
10
10
11−# Import testt
11+# Import test
12
12
13# class test
13# class test
14
14
@@ -16,14 +16,19 @@
16class Hello:
16class Hello:
17 def __init__(self, x):
17 def __init__(self, x):
18 self.name = x
18 self.name = x
19−
19+ 
20 def selfprint(self):
20 def selfprint(self):
21 print("hello my name is ", self.name)
21 print("hello my name is ", self.name)
22
22
23 def testprint(self):
23 def testprint(self):
24 print(1*2, 2+3, 4 % 5, 8-4, 9/4, 23//4)
24 print(1*2, 2+3, 4 % 5, 8-4, 9/4, 23//4)
25
25
26−
26+# Decorators test
27+class Decorators:
28+ @classmethod
29+ def decoratorsTest(self):
30+ pass
31+ 
27H1 = Hello("john")
32H1 = Hello("john")
28H1.selfprint()
33H1.selfprint()
29H1.testprint()
34H1.testprint()
@@ -37,8 +42,8 @@
37print(a[2])
42print(a[2])
38print(a[2:])
43print(a[2:])
39
44
40−# dictioary test
45+# dictionary test
41−# copied from w3school example
46+# copied from w3schools example
42
47
43myfamily = {
48myfamily = {
44 "child1": {
49 "child1": {
@@ -55,7 +60,7 @@
55 }
60 }
56}
61}
57
62
58−# touple test
63+# tuple test
59
64
60testTuple = ("one", 2, "3")
65testTuple = ("one", 2, "3")
61print(testTuple)
66print(testTuple)
@@ -70,7 +75,7 @@
70
75
71formattest = "teststring is ={}".format(5)
76formattest = "teststring is ={}".format(5)
72
77
73−# lamda test
78+# lambda test
74
79
75
80
76def x2(n):
81def x2(n):
tests/syntax-tests/source/Python/battest.py+12−7
@@ -8,7 +8,7 @@ from time import *
8h2 = 4 # this is a comment
8h2 = 4 # this is a comment
9"""this is also a comment"""
9"""this is also a comment"""
10
10
11−# Import testt
11+# Import test
12
12
13# class test
13# class test
14
14
@@ -16,14 +16,19 @@ h2 = 4 # this is a comment
16class Hello:
16class Hello:
17 def __init__(self, x):
17 def __init__(self, x):
18 self.name = x
18 self.name = x
19−
19+
20 def selfprint(self):
20 def selfprint(self):
21 print("hello my name is ", self.name)
21 print("hello my name is ", self.name)
22
22
23 def testprint(self):
23 def testprint(self):
24 print(1*2, 2+3, 4 % 5, 8-4, 9/4, 23//4)
24 print(1*2, 2+3, 4 % 5, 8-4, 9/4, 23//4)
25
25
26−
26+# Decorators test
27+class Decorators:
28+ @classmethod
29+ def decoratorsTest(self):
30+ pass
31+
27H1 = Hello("john")
32H1 = Hello("john")
28H1.selfprint()
33H1.selfprint()
29H1.testprint()
34H1.testprint()
@@ -37,8 +42,8 @@ print(a[:4])
37print(a[2])
42print(a[2])
38print(a[2:])
43print(a[2:])
39
44
40−# dictioary test
45+# dictionary test
41−# copied from w3school example
46+# copied from w3schools example
42
47
43myfamily = {
48myfamily = {
44 "child1": {
49 "child1": {
@@ -55,7 +60,7 @@ myfamily = {
55 }
60 }
56}
61}
57
62
58−# touple test
63+# tuple test
59
64
60testTuple = ("one", 2, "3")
65testTuple = ("one", 2, "3")
61print(testTuple)
66print(testTuple)
@@ -70,7 +75,7 @@ bye"""
70
75
71formattest = "teststring is ={}".format(5)
76formattest = "teststring is ={}".format(5)
72
77
73−# lamda test
78+# lambda test
74
79
75
80
76def x2(n):
81def x2(n):