diff --git a/test/test_literals.coffee b/test/test_literals.coffee index 308305df..28825271 100644 --- a/test/test_literals.coffee +++ b/test/test_literals.coffee @@ -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) diff --git a/test/test_regexps.coffee b/test/test_regexps.coffee index 5c11bd7b..5df2d7c3 100644 --- a/test/test_regexps.coffee +++ b/test/test_regexps.coffee @@ -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) \ No newline at end of file +ok regex.test(s2) diff --git a/test/test_string_interpolation.coffee b/test/test_strings.coffee similarity index 85% rename from test/test_string_interpolation.coffee rename to test/test_strings.coffee index e4c9d6e1..51d32dcb 100644 --- a/test/test_string_interpolation.coffee +++ b/test/test_strings.coffee @@ -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' \ No newline at end of file +ok "#{foo.replace("\"", "")}" is 'hello'