ruby/test/yarp/fuzzer_test.rb
Mike Dalessio c83552a596 [ruby/yarp] fix: trailing asterisk at end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

c86b4907b4
2023-08-30 18:27:49 +00:00

20 lines
536 B
Ruby

# frozen_string_literal: true
require_relative "test_helper"
# These tests are simply to exercise snippets found by the fuzzer that caused invalid memory access.
class FuzzerTest < Test::Unit::TestCase
class << self
def snippet(name, source)
test "fuzzer #{name}" do
YARP.dump(source)
end
end
end
snippet "incomplete global variable", "$"
snippet "incomplete symbol", ":"
snippet "incomplete escaped string", '"\\'
snippet "trailing comment", "1\n#\n"
snippet "trailing asterisk", "a *"
end