Skip to content

Commit 7798026

Browse files
committed
upgraded tests in preparation for python 3 parallel tests
1 parent d858959 commit 7798026

40 files changed

Lines changed: 4514 additions & 398 deletions

‎v3/example-code/list-comp.golden‎

Lines changed: 12 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,12 @@
3939
{
4040
"ordered_globals": [
4141
"ppl",
42-
"_[1]",
4342
"e"
4443
],
4544
"stdout": "",
4645
"func_name": "<module>",
4746
"stack_to_render": [],
4847
"globals": {
49-
"_[1]": [
50-
"REF",
51-
2
52-
],
5348
"e": "Alice",
5449
"ppl": [
5550
"REF",
@@ -63,10 +58,6 @@
6358
"Bob",
6459
"Carol",
6560
"Doug"
66-
],
67-
"2": [
68-
"LIST",
69-
"Alice!!"
7061
]
7162
},
7263
"line": 2,
@@ -75,17 +66,12 @@
7566
{
7667
"ordered_globals": [
7768
"ppl",
78-
"_[1]",
7969
"e"
8070
],
8171
"stdout": "",
8272
"func_name": "<module>",
8373
"stack_to_render": [],
8474
"globals": {
85-
"_[1]": [
86-
"REF",
87-
2
88-
],
8975
"e": "Bob",
9076
"ppl": [
9177
"REF",
@@ -99,11 +85,6 @@
9985
"Bob",
10086
"Carol",
10187
"Doug"
102-
],
103-
"2": [
104-
"LIST",
105-
"Alice!!",
106-
"Bob!!"
10788
]
10889
},
10990
"line": 2,
@@ -112,17 +93,12 @@
11293
{
11394
"ordered_globals": [
11495
"ppl",
115-
"_[1]",
11696
"e"
11797
],
11898
"stdout": "",
11999
"func_name": "<module>",
120100
"stack_to_render": [],
121101
"globals": {
122-
"_[1]": [
123-
"REF",
124-
2
125-
],
126102
"e": "Carol",
127103
"ppl": [
128104
"REF",
@@ -136,12 +112,6 @@
136112
"Bob",
137113
"Carol",
138114
"Doug"
139-
],
140-
"2": [
141-
"LIST",
142-
"Alice!!",
143-
"Bob!!",
144-
"Carol!!"
145115
]
146116
},
147117
"line": 2,
@@ -150,17 +120,12 @@
150120
{
151121
"ordered_globals": [
152122
"ppl",
153-
"_[1]",
154123
"e"
155124
],
156125
"stdout": "",
157126
"func_name": "<module>",
158127
"stack_to_render": [],
159128
"globals": {
160-
"_[1]": [
161-
"REF",
162-
2
163-
],
164129
"e": "Doug",
165130
"ppl": [
166131
"REF",
@@ -174,13 +139,6 @@
174139
"Bob",
175140
"Carol",
176141
"Doug"
177-
],
178-
"2": [
179-
"LIST",
180-
"Alice!!",
181-
"Bob!!",
182-
"Carol!!",
183-
"Doug!!"
184142
]
185143
},
186144
"line": 2,
@@ -230,27 +188,22 @@
230188
"ppl",
231189
"e",
232190
"excited_ppl",
233-
"x",
234-
"_[2]"
191+
"x"
235192
],
236193
"stdout": "",
237194
"func_name": "<module>",
238195
"stack_to_render": [],
239196
"globals": {
240-
"x": "Alice",
197+
"e": "Doug",
241198
"ppl": [
242199
"REF",
243200
1
244201
],
245-
"e": "Doug",
246202
"excited_ppl": [
247203
"REF",
248204
2
249205
],
250-
"_[2]": [
251-
"REF",
252-
3
253-
]
206+
"x": "Alice"
254207
},
255208
"heap": {
256209
"1": [
@@ -266,10 +219,6 @@
266219
"Bob!!",
267220
"Carol!!",
268221
"Doug!!"
269-
],
270-
"3": [
271-
"LIST",
272-
5
273222
]
274223
},
275224
"line": 3,
@@ -280,27 +229,22 @@
280229
"ppl",
281230
"e",
282231
"excited_ppl",
283-
"x",
284-
"_[2]"
232+
"x"
285233
],
286234
"stdout": "",
287235
"func_name": "<module>",
288236
"stack_to_render": [],
289237
"globals": {
290-
"x": "Bob",
238+
"e": "Doug",
291239
"ppl": [
292240
"REF",
293241
1
294242
],
295-
"e": "Doug",
296243
"excited_ppl": [
297244
"REF",
298245
2
299246
],
300-
"_[2]": [
301-
"REF",
302-
3
303-
]
247+
"x": "Bob"
304248
},
305249
"heap": {
306250
"1": [
@@ -316,11 +260,6 @@
316260
"Bob!!",
317261
"Carol!!",
318262
"Doug!!"
319-
],
320-
"3": [
321-
"LIST",
322-
5,
323-
3
324263
]
325264
},
326265
"line": 3,
@@ -331,27 +270,22 @@
331270
"ppl",
332271
"e",
333272
"excited_ppl",
334-
"x",
335-
"_[2]"
273+
"x"
336274
],
337275
"stdout": "",
338276
"func_name": "<module>",
339277
"stack_to_render": [],
340278
"globals": {
341-
"x": "Carol",
279+
"e": "Doug",
342280
"ppl": [
343281
"REF",
344282
1
345283
],
346-
"e": "Doug",
347284
"excited_ppl": [
348285
"REF",
349286
2
350287
],
351-
"_[2]": [
352-
"REF",
353-
3
354-
]
288+
"x": "Carol"
355289
},
356290
"heap": {
357291
"1": [
@@ -367,12 +301,6 @@
367301
"Bob!!",
368302
"Carol!!",
369303
"Doug!!"
370-
],
371-
"3": [
372-
"LIST",
373-
5,
374-
3,
375-
5
376304
]
377305
},
378306
"line": 3,
@@ -383,27 +311,22 @@
383311
"ppl",
384312
"e",
385313
"excited_ppl",
386-
"x",
387-
"_[2]"
314+
"x"
388315
],
389316
"stdout": "",
390317
"func_name": "<module>",
391318
"stack_to_render": [],
392319
"globals": {
393-
"x": "Doug",
320+
"e": "Doug",
394321
"ppl": [
395322
"REF",
396323
1
397324
],
398-
"e": "Doug",
399325
"excited_ppl": [
400326
"REF",
401327
2
402328
],
403-
"_[2]": [
404-
"REF",
405-
3
406-
]
329+
"x": "Doug"
407330
},
408331
"heap": {
409332
"1": [
@@ -419,13 +342,6 @@
419342
"Bob!!",
420343
"Carol!!",
421344
"Doug!!"
422-
],
423-
"3": [
424-
"LIST",
425-
5,
426-
3,
427-
5,
428-
4
429345
]
430346
},
431347
"line": 3,

‎v3/tests/backend-tests/caught_exception_1.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"code": "try:\n x = 1 / 0\nexcept:\n print \"DIVIDE BY ZERO\"\n\n",
2+
"code": "try:\n x = 1 / 0\nexcept:\n print(\"DIVIDE BY ZERO\")\n\n",
33
"trace": [
44
{
55
"ordered_globals": [],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
try:
22
x = 1 / 0
33
except:
4-
print "DIVIDE BY ZERO"
4+
print("DIVIDE BY ZERO")
55

‎v3/tests/backend-tests/caught_exception_2.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"code": "# caught exception:\ntry:\n x = 1 / 0\nexcept:\n print \"DIVIDE BY ZERO\"\n\n\n# uncaught:\nprint y\n\nprint \"should not reach here\"\n\n",
2+
"code": "# caught exception:\ntry:\n x = 1 / 0\nexcept:\n print(\"DIVIDE BY ZERO\")\n\n\n# uncaught:\nprint(y)\n\nprint(\"should not reach here\")\n\n",
33
"trace": [
44
{
55
"ordered_globals": [],

‎v3/tests/backend-tests/caught_exception_2.txt‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
try:
33
x = 1 / 0
44
except:
5-
print "DIVIDE BY ZERO"
5+
print("DIVIDE BY ZERO")
66

77

88
# uncaught:
9-
print y
9+
print(y)
1010

11-
print "should not reach here"
11+
print("should not reach here")
1212

‎v3/tests/backend-tests/class_test.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"code": "class Point:\n def __init__(self, x, y):\n self.x = x\n self.y = y\n \n def __str__(self):\n return \"(%d, %d)\" % (self.x, self.y)\n\np = Point(1, 2)\nprint p\np2 = Point(3, -4)\nprint p2\n\n",
2+
"code": "class Point:\n def __init__(self, x, y):\n self.x = x\n self.y = y\n \n def __str__(self):\n return \"(%d, %d)\" % (self.x, self.y)\n\np = Point(1, 2)\nprint(p)\np2 = Point(3, -4)\nprint(p2)\n\n",
33
"trace": [
44
{
55
"ordered_globals": [],

‎v3/tests/backend-tests/class_test.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Point:
77
return "(%d, %d)" % (self.x, self.y)
88

99
p = Point(1, 2)
10-
print p
10+
print(p)
1111
p2 = Point(3, -4)
12-
print p2
12+
print(p2)
1313

‎v3/tests/backend-tests/class_test_2.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"code": "class Outer():\n pass\n\no = Outer()\no.a = 5\no.b = \"Hi\"\nprint o\n\n",
2+
"code": "class Outer():\n pass\n\no = Outer()\no.a = 5\no.b = \"Hi\"\nprint(o)\n\n",
33
"trace": [
44
{
55
"ordered_globals": [],

‎v3/tests/backend-tests/class_test_2.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ class Outer():
44
o = Outer()
55
o.a = 5
66
o.b = "Hi"
7-
print o
7+
print(o)
88

‎v3/tests/backend-tests/class_test_3.golden‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"code": "class Staff601:\n course = '6.01'\n building = 34\n room = 501\n\npat = Staff601()\nprint pat.course\n\npat.name = 'Pat'\npat.age = 60\npat.role = 'Professor'\n\nprint pat.building\npat.building = 32\nprint pat.building\n\n",
2+
"code": "class Staff601:\n course = '6.01'\n building = 34\n room = 501\n\npat = Staff601()\nprint(pat.course)\n\npat.name = 'Pat'\npat.age = 60\npat.role = 'Professor'\n\nprint(pat.building)\npat.building = 32\nprint(pat.building)\n\n",
33
"trace": [
44
{
55
"ordered_globals": [],

0 commit comments

Comments
 (0)