Sync ruby/yarp with sync_default_gems
This commit is contained in:
parent
1344de5621
commit
edd488109f
@ -3,19 +3,6 @@
|
||||
require "yarp_test_helper"
|
||||
|
||||
class ParseTest < Test::Unit::TestCase
|
||||
# Because we're reading the snapshots from disk, we need to make sure that
|
||||
# they're encoded as UTF-8. When certain settings are present this might not
|
||||
# always be the case (e.g., LANG=C or -Eascii-8bit). So here we force the
|
||||
# default external encoding for the duration of the test.
|
||||
def setup
|
||||
@previous_default_external = Encoding.default_external
|
||||
Encoding.default_external = Encoding::UTF_8
|
||||
end
|
||||
|
||||
def teardown
|
||||
Encoding.default_external = @previous_default_external
|
||||
end
|
||||
|
||||
def test_Ruby_3_2_plus
|
||||
assert_operator RUBY_VERSION, :>=, "3.2.0", "ParseTest requires Ruby 3.2+"
|
||||
end
|
||||
@ -34,6 +21,7 @@ class ParseTest < Test::Unit::TestCase
|
||||
# and the line breaks based on the length of the path.
|
||||
def normalize_printed(printed)
|
||||
printed
|
||||
.b
|
||||
.gsub(
|
||||
/SourceFileNode \s*
|
||||
\(\s* (\d+\.\.\.\d+) \s*\) \s*
|
||||
@ -87,7 +75,7 @@ class ParseTest < Test::Unit::TestCase
|
||||
assert_empty result.errors, value
|
||||
|
||||
if File.exist?(snapshot)
|
||||
normalized = normalize_printed(File.read(snapshot))
|
||||
normalized = normalize_printed(File.binread(snapshot))
|
||||
|
||||
# If the snapshot file exists, but the printed value does not match the
|
||||
# snapshot, then update the snapshot file.
|
||||
|
@ -72,7 +72,6 @@ source_file_load(source_t *source, VALUE filepath) {
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
if (!source->size) {
|
||||
close(fd);
|
||||
source->source = "";
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user