2014-10-26 06:24:18 +03:00
|
|
|
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")
|
2014-11-19 20:10:35 +03:00
|
|
|
assert_nil Ripper.sexp("/*")
|
|
|
|
assert_nil Ripper.sexp("/*/")
|
|
|
|
assert_nil Ripper.sexp("/+/")
|
2014-10-26 06:24:18 +03:00
|
|
|
end
|
|
|
|
end if ripper_test
|