From 1c1c067ce61080b048de22a2e71e521d7a64a575 Mon Sep 17 00:00:00 2001 From: Herwin Date: Mon, 30 Sep 2024 08:52:33 +0200 Subject: [PATCH] Split multibyte class names from Marshal fixtures into their own file This removes the dependency on module_eval. It does use the magic comment to force the file encoding, but that one is present in the main fixture as well. --- core/marshal/fixtures/marshal_data.rb | 14 +++----------- core/marshal/fixtures/marshal_multibyte_data.rb | 12 ++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 core/marshal/fixtures/marshal_multibyte_data.rb diff --git a/core/marshal/fixtures/marshal_data.rb b/core/marshal/fixtures/marshal_data.rb index a508b6bea..aae3fce0a 100644 --- a/core/marshal/fixtures/marshal_data.rb +++ b/core/marshal/fixtures/marshal_data.rb @@ -1,4 +1,7 @@ # -*- encoding: binary -*- + +require_relative 'marshal_multibyte_data' + class UserDefined class Nested def ==(other) @@ -267,17 +270,6 @@ def self.name end end - module_eval(<<~ruby.dup.force_encoding(Encoding::UTF_8)) - class MultibyteぁあぃいClass - end - - module MultibyteけげこごModule - end - - class MultibyteぁあぃいTime < Time - end - ruby - class ObjectWithFreezeRaisingException < Object def freeze raise diff --git a/core/marshal/fixtures/marshal_multibyte_data.rb b/core/marshal/fixtures/marshal_multibyte_data.rb new file mode 100644 index 000000000..98a0d4339 --- /dev/null +++ b/core/marshal/fixtures/marshal_multibyte_data.rb @@ -0,0 +1,12 @@ +# -*- encoding: utf-8 -*- + +module MarshalSpec + class MultibyteぁあぃいClass + end + + module MultibyteけげこごModule + end + + class MultibyteぁあぃいTime < Time + end +end