summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-15 08:55:56 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-15 08:55:56 +0000
commit402906e265bf5eeb94d6de5db2246ca15c4746a7 (patch)
tree55b1c501769fc69c14b56fc21a7467805526a59d /test
parentda7dedecae53231a949e31af0b4d319b298e6ddf (diff)
merge revision(s) 66736: [Backport #15511]
ast.c: argument must be a string [ruby-core:90904] [Bug #15511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@66827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_ast.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 055567d574..23cd5618a0 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -134,6 +134,14 @@ class TestAst < Test::Unit::TestCase
assert_raise(TypeError) {RubyVM::AbstractSyntaxTree::Node.allocate}
end
+ def test_parse_argument_error
+ assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(0)}
+ assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(nil)}
+ assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(false)}
+ assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(true)}
+ assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(:foo)}
+ end
+
def test_column_with_long_heredoc_identifier
term = "A"*257
ast = RubyVM::AbstractSyntaxTree.parse("<<-#{term}\n""ddddddd\n#{term}\n")