test/parse_test.rb in cast-0.2.0 vs test/parse_test.rb in cast-0.2.1
- old
+ new
@@ -2,11 +2,11 @@
#
# Tests for the parse methods.
#
######################################################################
-require 'test/test_helper'
+require 'test_helper'
class MatchTest < Test::Unit::TestCase
def setup
C.default_parser = C::Parser.new
end
@@ -1930,9 +1930,18 @@
assert_raise(C::ParseError){C::StringLiteral.parse('if (0)')}
assert_raise(C::ParseError){C::StringLiteral.parse('switch (0)')}
assert_raise(C::ParseError){C::StringLiteral.parse('for (;;)')}
assert_raise(C::ParseError){C::StringLiteral.parse('goto')}
assert_raise(C::ParseError){C::StringLiteral.parse('return')}
+ end
+
+ def test_string_literal_concatenation
+ check C::StringLiteral, <<EOS
+"hello" " " "world!"
+----
+StringLiteral
+ val: "hello world!"
+EOS
end
def test_char_literal
check C::CharLiteral, <<EOS
'x'