summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-26 03:24:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-26 03:24:18 +0000
commitd1ec43ae7ab2a4e529ee8eed21c2894b565a6862 (patch)
tree2878cbb473453a90bb617788866cc4961bd22948 /test/ripper
parent3bf0628a70ea72b55713458d40271dd3e5537d19 (diff)
parse.y: Ripper.sexp returns error
* ext/ripper/lib/ripper/sexp.rb (Ripper.sexp, Ripper.sexp_raw): return nil on error. [ruby-dev:48678] [Bug #10405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_sexp.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ripper/test_sexp.rb b/test/ripper/test_sexp.rb
new file mode 100644
index 0000000..92df1ae
--- /dev/null
+++ b/test/ripper/test_sexp.rb
@@ -0,0 +1,18 @@
+begin
+ require 'ripper'
+ require 'test/unit'
+ ripper_test = true
+ module TestRipper; end
+rescue LoadError
+end
+
+class TestRipper::Sexp < Test::Unit::TestCase
+ def test_compile_error
+ assert_nil Ripper.sexp("/")
+ assert_nil Ripper.sexp("-")
+ assert_nil Ripper.sexp("+")
+ assert_nil Ripper.sexp("*")
+ assert_nil Ripper.sexp("end")
+ assert_nil Ripper.sexp("end 1")
+ end
+end if ripper_test