Skip to content

Commit

Permalink
Split multibyte class names from Marshal fixtures into their own file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
herwinw committed Oct 3, 2024
1 parent f40a48b commit 1c1c067
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 3 additions & 11 deletions core/marshal/fixtures/marshal_data.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# -*- encoding: binary -*-

require_relative 'marshal_multibyte_data'

class UserDefined
class Nested
def ==(other)
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions core/marshal/fixtures/marshal_multibyte_data.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- encoding: utf-8 -*-

module MarshalSpec
class MultibyteぁあぃいClass
end

module MultibyteけげこごModule
end

class MultibyteぁあぃいTime < Time
end
end

0 comments on commit 1c1c067

Please sign in to comment.