From 9230f32c6a9dbbe3bd0bfc17f89fd38a34016b48 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Sat, 18 Mar 2023 15:47:21 +0100 Subject: [PATCH] Using these tests as docs broke my mind --- spec/04_packer_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/04_packer_spec.rb b/spec/04_packer_spec.rb index 4ca1ef4..f075d6f 100644 --- a/spec/04_packer_spec.rb +++ b/spec/04_packer_spec.rb @@ -23,10 +23,10 @@ describe 'Packer', :packer do end it 'Should pack negative match binary' do - expect(Packer.pack_int(-1).first.to_s(2)).to eq('1000000') - expect(Packer.pack_int(-2).first.to_s(2)).to eq('1000001') - expect(Packer.pack_int(-3).first.to_s(2)).to eq('1000010') - expect(Packer.pack_int(-4).first.to_s(2)).to eq('1000011') + expect(Packer.pack_int(-1).first.to_s(2).rjust(8, '0')).to eq('01000000') + expect(Packer.pack_int(-2).first.to_s(2).rjust(8, '0')).to eq('01000001') + expect(Packer.pack_int(-3).first.to_s(2).rjust(8, '0')).to eq('01000010') + expect(Packer.pack_int(-4).first.to_s(2).rjust(8, '0')).to eq('01000011') end # https://github.com/ddnet/ddnet/pull/6015