From 440cdceffb7efef0aa93ad519b056a25d610f52d Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 29 Aug 2023 16:36:18 -0400 Subject: [ruby/yarp] test: new test file for capturing interesting fuzzer snippets Note that we call `YARP.dump` for these fuzzer tests to better match the fuzz.parse harness, which also serializes. https://github.com/ruby/yarp/commit/032ad047e9 --- test/yarp/fuzzer_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/yarp/fuzzer_test.rb diff --git a/test/yarp/fuzzer_test.rb b/test/yarp/fuzzer_test.rb new file mode 100644 index 0000000000..3aed73ecd5 --- /dev/null +++ b/test/yarp/fuzzer_test.rb @@ -0,0 +1,14 @@ +# 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 +end -- cgit v1.2.3