(name, ls, le, cs, ce)
| 263 | ], |
| 264 | ) |
| 265 | def test_parsing(name, ls, le, cs, ce): |
| 266 | stu_code = """ |
| 267 | if True: |
| 268 | a = 1 |
| 269 | |
| 270 | if False: |
| 271 | b = 2 |
| 272 | else: |
| 273 | c = 3 |
| 274 | |
| 275 | for i in range(2): |
| 276 | d = 4 |
| 277 | |
| 278 | x = 2 |
| 279 | while x > 0: |
| 280 | e = 5 |
| 281 | x -= 1 |
| 282 | |
| 283 | try: |
| 284 | f = 6 |
| 285 | except: |
| 286 | pass |
| 287 | |
| 288 | try: |
| 289 | g = 7 |
| 290 | except: |
| 291 | pass |
| 292 | finally: |
| 293 | h = 8 |
| 294 | |
| 295 | # 2 assignments |
| 296 | i = 9 |
| 297 | if True: |
| 298 | i = 9 |
| 299 | """ |
| 300 | sol_code = """ |
| 301 | if True: |
| 302 | a = 10 |
| 303 | |
| 304 | if False: |
| 305 | b = 20 |
| 306 | else: |
| 307 | c = 30 |
| 308 | |
| 309 | for i in range(2): |
| 310 | d = 40 |
| 311 | |
| 312 | x = 2 |
| 313 | while x > 0: |
| 314 | e = 50 |
| 315 | x -= 1 |
| 316 | |
| 317 | try: |
| 318 | f = 60 |
| 319 | except: |
| 320 | pass |
| 321 | |
| 322 | try: |