stripped out strings/regexes from test_literals; test_string_interpolation is now test_string

This commit is contained in:
satyr 2010-10-12 09:35:59 +09:00
parent b01d7db409
commit ed79715841
3 changed files with 26 additions and 29 deletions

View File

@ -3,12 +3,6 @@ a = [((x) -> x), ((x) -> x * x)]
ok a.length is 2
regex = /match/i
words = "I think there is a match in here."
ok !!words.match(regex)
neg = (3 -4)
ok neg is -1
@ -34,27 +28,6 @@ func = ->
ok func() is undefined
eq /\\/.source, "\\\\"
eq '(((dollars)))', '\(\(\(dollars\)\)\)'
eq 'one two three', "one
two
three"
eq "four five", 'four
five'
#647
eq "''Hello, World\\''", '''
'\'Hello, World\\\''
'''
eq '""Hello, World\\""', """
"\"Hello, World\\\""
"""
eq 'Hello, World\n', '''
Hello, World\
'''
trailingComma = [1, 2, 3,]
ok (trailingComma[0] is 1) and (trailingComma[2] is 3) and (trailingComma.length is 3)

View File

@ -22,6 +22,9 @@ id = 2
ok (obj.width()/id - obj.height()/id) is -5
eq /\\/.source, "\\\\"
eq /^I'm\s+Heregex?\/\/\//gim + '', ///
^ I'm \s+ Heregex? / // # or not
///gim + ''
@ -41,4 +44,4 @@ regex = /[/]/
s1 = "Hello there"
s2 = "Hello / there"
ok not regex.test(s1)
ok regex.test(s2)
ok regex.test(s2)

View File

@ -1,3 +1,24 @@
eq '(((dollars)))', '\(\(\(dollars\)\)\)'
eq 'one two three', "one
two
three"
eq "four five", 'four
five'
#647
eq "''Hello, World\\''", '''
'\'Hello, World\\\''
'''
eq '""Hello, World\\""', """
"\"Hello, World\\\""
"""
eq 'Hello, World\n', '''
Hello, World\
'''
hello = 'Hello'
world = 'World'
ok '#{hello} #{world}!' is '#{hello} #{world}!'
@ -77,4 +98,4 @@ ok result is 'a bb c'
foo = "hello"
ok "#{foo.replace("\"", "")}" is 'hello'
ok "#{foo.replace("\"", "")}" is 'hello'