1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/test/test_heredocs.coffee

73 lines
697 B
CoffeeScript
Raw Normal View History

2010-07-25 01:23:37 -04:00
a = """
basic heredoc
on two lines
"""
2010-01-11 23:53:50 -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
ok a is "a\n \"b\nc"
2010-01-11 23:53:50 -05:00
2010-07-25 01:23:37 -04:00
a = '''one-liner'''
2010-01-11 23:53:50 -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
"""
ok a is "out\nhere"
2010-07-25 01:23:37 -04:00
a = '''
a
b
c
'''
ok a is " a\n b\nc"
2010-07-25 01:23:37 -04:00
a = '''
a
b c
'''
ok a is "a\n\n\nb c"
2010-07-25 01:23:37 -04:00
a = '''more"than"one"quote'''
ok a is 'more"than"one"quote'
2010-07-25 01:23:37 -04:00
val = 10
2010-07-25 01:23:37 -04:00
a = """
basic heredoc #val
2010-07-25 01:23:37 -04:00
on two lines
"""
2010-07-25 01:23:37 -04:00
b = '''
basic heredoc #val
2010-07-25 01:23:37 -04:00
on two lines
'''
ok a is "basic heredoc 10\non two lines"
ok b is "basic heredoc \#val\non two lines"
2010-07-25 01:23:37 -04:00
a = '''here's an apostrophe'''
ok a is "here's an apostrophe"