ruby-changes:71788
From: Nobuyoshi <ko1@a...>
Date: Tue, 10 May 2022 10:15:50 +0900 (JST)
Subject: [ruby-changes:71788] d0983af61c (master): Fix the order of assert_eqaul and remove unused variables
https://git.ruby-lang.org/ruby.git/commit/?id=d0983af61c From d0983af61c115ba2793df1a840b8a531317c5acf Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 10 May 2022 10:15:27 +0900 Subject: Fix the order of assert_eqaul and remove unused variables --- test/ruby/test_io_buffer.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/test/ruby/test_io_buffer.rb b/test/ruby/test_io_buffer.rb index d77f0afec8..0f8a9c5e80 100644 --- a/test/ruby/test_io_buffer.rb +++ b/test/ruby/test_io_buffer.rb @@ -335,22 +335,20 @@ class TestIOBuffer < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io_buffer.rb#L335 def test_operators source = IO::Buffer.for("1234123412") mask = IO::Buffer.for("133\x00") - result = source & mask - assert_equal (source & mask), IO::Buffer.for("123\x00123\x0012") - assert_equal (source | mask), IO::Buffer.for("1334133413") - assert_equal (source ^ mask), IO::Buffer.for("\x00\x01\x004\x00\x01\x004\x00\x01") - assert_equal ~source, IO::Buffer.for("\xce\xcd\xcc\xcb\xce\xcd\xcc\xcb\xce\xcd") + assert_equal IO::Buffer.for("123\x00123\x0012"), (source & mask) + assert_equal IO::Buffer.for("1334133413"), (source | mask) + assert_equal IO::Buffer.for("\x00\x01\x004\x00\x01\x004\x00\x01"), (source ^ mask) + assert_equal IO::Buffer.for("\xce\xcd\xcc\xcb\xce\xcd\xcc\xcb\xce\xcd"), ~source end def test_inplace_operators source = IO::Buffer.for("1234123412") mask = IO::Buffer.for("133\x00") - result = source & mask - assert_equal source.dup.and!(mask), IO::Buffer.for("123\x00123\x0012") - assert_equal source.dup.or!(mask), IO::Buffer.for("1334133413") - assert_equal source.dup.xor!(mask), IO::Buffer.for("\x00\x01\x004\x00\x01\x004\x00\x01") - assert_equal source.dup.not!, IO::Buffer.for("\xce\xcd\xcc\xcb\xce\xcd\xcc\xcb\xce\xcd") + assert_equal IO::Buffer.for("123\x00123\x0012"), source.dup.and!(mask) + assert_equal IO::Buffer.for("1334133413"), source.dup.or!(mask) + assert_equal IO::Buffer.for("\x00\x01\x004\x00\x01\x004\x00\x01"), source.dup.xor!(mask) + assert_equal IO::Buffer.for("\xce\xcd\xcc\xcb\xce\xcd\xcc\xcb\xce\xcd"), source.dup.not! end end -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/