diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-06-22 08:59:04 -0700 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2023-06-22 08:59:04 -0700 |
| commit | edd488109fe8a95ec8674886905fe503fc0f9108 (patch) | |
| tree | 260cbc19f4fc3e00d312dc8425b2bfadf0759ec5 /test | |
| parent | 1344de56219cf83ca146c5346783f8483af534f9 (diff) | |
Sync ruby/yarp with sync_default_gems
Diffstat (limited to 'test')
| -rw-r--r-- | test/yarp/parse_test.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/test/yarp/parse_test.rb b/test/yarp/parse_test.rb index 098ce7b3fc..33f78bda8c 100644 --- a/test/yarp/parse_test.rb +++ b/test/yarp/parse_test.rb @@ -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. |
