2010-07-25 01:23:37 -04:00
|
|
|
a = """
|
|
|
|
basic heredoc
|
|
|
|
on two lines
|
|
|
|
"""
|
2010-01-11 23:53:50 -05:00
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok a is "basic heredoc\non two lines"
|
2010-01-11 23:53:50 -05:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = '''
|
|
|
|
a
|
|
|
|
"b
|
|
|
|
c
|
|
|
|
'''
|
2010-01-11 23:53:50 -05:00
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok a is "a\n \"b\nc"
|
2010-01-11 23:53:50 -05:00
|
|
|
|
|
|
|
|
2010-09-15 22:08:13 -04:00
|
|
|
a = """
|
|
|
|
a
|
|
|
|
b
|
|
|
|
c
|
|
|
|
"""
|
|
|
|
|
|
|
|
ok a is "a\n b\n c"
|
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = '''one-liner'''
|
2010-01-11 23:53:50 -05:00
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok a is 'one-liner'
|
2010-01-11 23:53:50 -05:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = """
|
2010-01-11 23:53:50 -05:00
|
|
|
out
|
|
|
|
here
|
|
|
|
"""
|
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok a is "out\nhere"
|
2010-01-12 23:06:12 -05:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = '''
|
|
|
|
a
|
|
|
|
b
|
|
|
|
c
|
|
|
|
'''
|
2010-01-12 23:06:12 -05:00
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok a is " a\n b\nc"
|
2010-01-19 09:49:23 -05:00
|
|
|
|
2010-02-28 10:29:30 -05:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = '''
|
2010-01-19 09:49:23 -05:00
|
|
|
a
|
|
|
|
|
|
|
|
|
|
|
|
b c
|
|
|
|
'''
|
|
|
|
|
2010-02-16 19:45:25 -05:00
|
|
|
ok a is "a\n\n\nb c"
|
2010-02-28 10:29:30 -05:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = '''more"than"one"quote'''
|
2010-02-28 10:29:30 -05:00
|
|
|
|
2010-03-17 20:47:27 -04:00
|
|
|
ok a is 'more"than"one"quote'
|
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
val = 10
|
2010-03-17 20:47:27 -04:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = """
|
2010-08-07 08:02:16 -04:00
|
|
|
basic heredoc #{val}
|
2010-07-25 01:23:37 -04:00
|
|
|
on two lines
|
|
|
|
"""
|
2010-03-17 20:47:27 -04:00
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
b = '''
|
2010-08-07 08:02:16 -04:00
|
|
|
basic heredoc #{val}
|
2010-07-25 01:23:37 -04:00
|
|
|
on two lines
|
|
|
|
'''
|
2010-03-17 20:47:27 -04:00
|
|
|
|
|
|
|
ok a is "basic heredoc 10\non two lines"
|
2010-08-07 08:02:16 -04:00
|
|
|
ok b is "basic heredoc \#{val}\non two lines"
|
2010-06-02 19:53:03 -04:00
|
|
|
|
|
|
|
|
2010-07-25 01:23:37 -04:00
|
|
|
a = '''here's an apostrophe'''
|
2010-06-02 19:53:03 -04:00
|
|
|
ok a is "here's an apostrophe"
|
2010-09-22 09:47:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
# The indentation detector ignores blank lines without trailing whitespace
|
|
|
|
a = """
|
|
|
|
one
|
|
|
|
two
|
|
|
|
|
|
|
|
"""
|
|
|
|
ok a is "one\ntwo\n"
|
2010-09-25 14:25:53 -04:00
|
|
|
|
2010-10-04 14:30:48 -04:00
|
|
|
eq ''' line 0
|
2010-09-25 14:25:53 -04:00
|
|
|
should not be relevant
|
|
|
|
to the indent level
|
|
|
|
''', '
|
|
|
|
line 0\n
|
|
|
|
should not be relevant\n
|
|
|
|
to the indent level
|
|
|
|
'
|
2010-09-25 18:06:14 -04:00
|
|
|
|
2010-10-04 14:30:48 -04:00
|
|
|
eq ''' '\\\' ''', " '\\' "
|
|
|
|
eq """ "\\\" """, ' "\\" '
|
|
|
|
|
|
|
|
eq ''' <- keep these spaces -> ''', ' <- keep these spaces -> '
|
2010-09-25 18:06:14 -04:00
|
|
|
|
2010-10-04 14:30:48 -04:00
|
|
|
eq 'multiline nested "interpolations" work', """multiline #{
|
2010-09-25 18:06:14 -04:00
|
|
|
"nested #{(->
|
|
|
|
ok yes
|
2010-10-04 14:30:48 -04:00
|
|
|
"\"interpolations\""
|
2010-09-25 18:06:14 -04:00
|
|
|
)()}"
|
|
|
|
} work"""
|