File: blocks.py

package info (click to toggle)
kid 0.6.3-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 588 kB
  • ctags: 588
  • sloc: python: 2,447; makefile: 5; xml: 4
file content (33 lines) | stat: -rw-r--r-- 381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
A bunch of code blocks for testing indentation detection..
"""

blocks = []

def block(text, expect=None):
    blocks.append( (text.strip(), (expect or text).strip()) )

block("""
if x:
    print 'foo'
  else:
    print 'bar'
""","""
if x:
  print 'foo'
else:
  print 'bar'
""")

block("""
if x:
\tprint 'foo'
\tif y:
\t\tprint 'bar'
""")

block("""
import bla
bla.bla()
""")