mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

* 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
18 lines
409 B
Ruby
18 lines
409 B
Ruby
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
|