From 5b6ebddb9786426e2f7b4dae4478ada22ce9e975 Mon Sep 17 00:00:00 2001 From: mjago Date: Wed, 19 Oct 2016 22:31:55 +0100 Subject: [PATCH 1/5] Array pack with format J and j specs --- core/array/pack/j_spec.rb | 127 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 core/array/pack/j_spec.rb diff --git a/core/array/pack/j_spec.rb b/core/array/pack/j_spec.rb new file mode 100644 index 0000000000..564dcdd4b4 --- /dev/null +++ b/core/array/pack/j_spec.rb @@ -0,0 +1,127 @@ +require File.expand_path('../../../../spec_helper', __FILE__) +require File.expand_path('../../fixtures/classes', __FILE__) +require File.expand_path('../shared/basic', __FILE__) +require File.expand_path('../shared/numeric_basic', __FILE__) +require File.expand_path('../shared/integer', __FILE__) +require 'fiddle' + +def pointer_size_is size + yield if Fiddle::SIZEOF_INTPTR_T == size +end + +ruby_version_is '2.3' do + + pointer_size_is 8 do + + describe "Array#pack with format 'J'" do + it_behaves_like :array_pack_basic, 'J' + it_behaves_like :array_pack_basic_non_float, 'J' + it_behaves_like :array_pack_arguments, 'J' + it_behaves_like :array_pack_numeric_basic, 'J' + it_behaves_like :array_pack_integer, 'J' + end + + describe "Array#pack with format 'j'" do + it_behaves_like :array_pack_basic, 'j' + it_behaves_like :array_pack_basic_non_float, 'j' + it_behaves_like :array_pack_arguments, 'j' + it_behaves_like :array_pack_numeric_basic, 'j' + it_behaves_like :array_pack_integer, 'j' + end + + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_64bit_le, 'J_' + it_behaves_like :array_pack_64bit_le, 'j_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_64bit_le, 'J!' + it_behaves_like :array_pack_64bit_le, 'j!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_64bit_le, 'J<_' + it_behaves_like :array_pack_64bit_le, 'J_<' + it_behaves_like :array_pack_64bit_le, 'j<_' + it_behaves_like :array_pack_64bit_le, 'j_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_64bit_le, 'J' and '_'" do + it_behaves_like :array_pack_64bit_be, 'J>_' + it_behaves_like :array_pack_64bit_be, 'J_>' + it_behaves_like :array_pack_64bit_be, 'j>_' + it_behaves_like :array_pack_64bit_be, 'j_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_64bit_be, 'J>!' + it_behaves_like :array_pack_64bit_be, 'J!>' + it_behaves_like :array_pack_64bit_be, 'j>!' + it_behaves_like :array_pack_64bit_be, 'j!>' + end + + pointer_size_is 4 do + + describe "Array#pack with format 'J'" do + it_behaves_like :array_pack_basic, 'J' + it_behaves_like :array_pack_basic_non_float, 'J' + it_behaves_like :array_pack_arguments, 'J' + it_behaves_like :array_pack_numeric_basic, 'J' + it_behaves_like :array_pack_integer, 'J' + end + + describe "Array#pack with format 'j'" do + it_behaves_like :array_pack_basic, 'j' + it_behaves_like :array_pack_basic_non_float, 'j' + it_behaves_like :array_pack_arguments, 'j' + it_behaves_like :array_pack_numeric_basic, 'j' + it_behaves_like :array_pack_integer, 'j' + end + + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_32bit_le, 'J_' + it_behaves_like :array_pack_32bit_le, 'j_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_32bit_le, 'J!' + it_behaves_like :array_pack_32bit_le, 'j!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_32bit_le, 'J<_' + it_behaves_like :array_pack_32bit_le, 'J_<' + it_behaves_like :array_pack_32bit_le, 'j<_' + it_behaves_like :array_pack_32bit_le, 'j_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_32bit_le, 'J' and '_'" do + it_behaves_like :array_pack_32bit_be, 'J>_' + it_behaves_like :array_pack_32bit_be, 'J_>' + it_behaves_like :array_pack_32bit_be, 'j>_' + it_behaves_like :array_pack_32bit_be, 'j_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_32bit_be, 'J>!' + it_behaves_like :array_pack_32bit_be, 'J!>' + it_behaves_like :array_pack_32bit_be, 'j>!' + it_behaves_like :array_pack_32bit_be, 'j!>' + end + end + end +end From f3ec3da57165ce4644e8c25b32def4e63429e8e4 Mon Sep 17 00:00:00 2001 From: mjago Date: Thu, 20 Oct 2016 11:16:11 +0100 Subject: [PATCH 2/5] Remove dependency on Fiddle and use wordsize guard in Array pack with format J and j specs --- core/array/pack/j_spec.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/core/array/pack/j_spec.rb b/core/array/pack/j_spec.rb index 564dcdd4b4..86358833c3 100644 --- a/core/array/pack/j_spec.rb +++ b/core/array/pack/j_spec.rb @@ -3,15 +3,10 @@ require File.expand_path('../shared/basic', __FILE__) require File.expand_path('../shared/numeric_basic', __FILE__) require File.expand_path('../shared/integer', __FILE__) -require 'fiddle' - -def pointer_size_is size - yield if Fiddle::SIZEOF_INTPTR_T == size -end ruby_version_is '2.3' do - pointer_size_is 8 do + platform_is wordsize: 64 do describe "Array#pack with format 'J'" do it_behaves_like :array_pack_basic, 'J' @@ -67,7 +62,7 @@ def pointer_size_is size it_behaves_like :array_pack_64bit_be, 'j!>' end - pointer_size_is 4 do + platform_is wordsize: 32 do describe "Array#pack with format 'J'" do it_behaves_like :array_pack_basic, 'J' From 5df898c6d4bfefd1e2bce0432fa7254da1ec5c2c Mon Sep 17 00:00:00 2001 From: mjago Date: Thu, 20 Oct 2016 11:33:29 +0100 Subject: [PATCH 3/5] Add mingw32 guards to pack array with format J --- core/array/pack/j_spec.rb | 138 +++++++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 47 deletions(-) diff --git a/core/array/pack/j_spec.rb b/core/array/pack/j_spec.rb index 86358833c3..d09d3d6a57 100644 --- a/core/array/pack/j_spec.rb +++ b/core/array/pack/j_spec.rb @@ -24,61 +24,48 @@ it_behaves_like :array_pack_integer, 'j' end - describe "Array#pack with modifier '_'" do - it_behaves_like :array_pack_64bit_le, 'J_' - it_behaves_like :array_pack_64bit_le, 'j_' - end - - describe "Array#pack with modifier '!'" do - it_behaves_like :array_pack_64bit_le, 'J!' - it_behaves_like :array_pack_64bit_le, 'j!' - end - - describe "Array#pack with modifier '<' and '_'" do - it_behaves_like :array_pack_64bit_le, 'J<_' - it_behaves_like :array_pack_64bit_le, 'J_<' - it_behaves_like :array_pack_64bit_le, 'j<_' - it_behaves_like :array_pack_64bit_le, 'j_<' - end + platform_is_not :mingw32 do - describe "Array#pack with modifier '<' and '!'" do - it_behaves_like :array_pack_64bit_le, 'J' and '_'" do - it_behaves_like :array_pack_64bit_be, 'J>_' - it_behaves_like :array_pack_64bit_be, 'J_>' - it_behaves_like :array_pack_64bit_be, 'j>_' - it_behaves_like :array_pack_64bit_be, 'j_>' - end + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_64bit_le, 'J!' + it_behaves_like :array_pack_64bit_le, 'j!' + end - describe "Array#pack with modifier '>' and '!'" do - it_behaves_like :array_pack_64bit_be, 'J>!' - it_behaves_like :array_pack_64bit_be, 'J!>' - it_behaves_like :array_pack_64bit_be, 'j>!' - it_behaves_like :array_pack_64bit_be, 'j!>' - end + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_64bit_le, 'J<_' + it_behaves_like :array_pack_64bit_le, 'J_<' + it_behaves_like :array_pack_64bit_le, 'j<_' + it_behaves_like :array_pack_64bit_le, 'j_<' + end - platform_is wordsize: 32 do + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_64bit_le, 'J' and '_'" do + it_behaves_like :array_pack_64bit_be, 'J>_' + it_behaves_like :array_pack_64bit_be, 'J_>' + it_behaves_like :array_pack_64bit_be, 'j>_' + it_behaves_like :array_pack_64bit_be, 'j_>' end - describe "Array#pack with format 'j'" do - it_behaves_like :array_pack_basic, 'j' - it_behaves_like :array_pack_basic_non_float, 'j' - it_behaves_like :array_pack_arguments, 'j' - it_behaves_like :array_pack_numeric_basic, 'j' - it_behaves_like :array_pack_integer, 'j' + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_64bit_be, 'J>!' + it_behaves_like :array_pack_64bit_be, 'J!>' + it_behaves_like :array_pack_64bit_be, 'j>!' + it_behaves_like :array_pack_64bit_be, 'j!>' end + end + + platform_is :mingw32 do describe "Array#pack with modifier '_'" do it_behaves_like :array_pack_32bit_le, 'J_' @@ -119,4 +106,61 @@ end end end + + platform_is wordsize: 32 do + + describe "Array#pack with format 'J'" do + it_behaves_like :array_pack_basic, 'J' + it_behaves_like :array_pack_basic_non_float, 'J' + it_behaves_like :array_pack_arguments, 'J' + it_behaves_like :array_pack_numeric_basic, 'J' + it_behaves_like :array_pack_integer, 'J' + end + + describe "Array#pack with format 'j'" do + it_behaves_like :array_pack_basic, 'j' + it_behaves_like :array_pack_basic_non_float, 'j' + it_behaves_like :array_pack_arguments, 'j' + it_behaves_like :array_pack_numeric_basic, 'j' + it_behaves_like :array_pack_integer, 'j' + end + + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_32bit_le, 'J_' + it_behaves_like :array_pack_32bit_le, 'j_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_32bit_le, 'J!' + it_behaves_like :array_pack_32bit_le, 'j!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_32bit_le, 'J<_' + it_behaves_like :array_pack_32bit_le, 'J_<' + it_behaves_like :array_pack_32bit_le, 'j<_' + it_behaves_like :array_pack_32bit_le, 'j_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_32bit_le, 'J' and '_'" do + it_behaves_like :array_pack_32bit_be, 'J>_' + it_behaves_like :array_pack_32bit_be, 'J_>' + it_behaves_like :array_pack_32bit_be, 'j>_' + it_behaves_like :array_pack_32bit_be, 'j_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_32bit_be, 'J>!' + it_behaves_like :array_pack_32bit_be, 'J!>' + it_behaves_like :array_pack_32bit_be, 'j>!' + it_behaves_like :array_pack_32bit_be, 'j!>' + end + end end From 9fd41f957efd45a4c7482695e1b26dc9fc91fefe Mon Sep 17 00:00:00 2001 From: mjago Date: Thu, 20 Oct 2016 15:21:08 +0100 Subject: [PATCH 4/5] Formatting --- core/array/pack/j_spec.rb | 243 ++++++++++++++++++++++++-------------- 1 file changed, 152 insertions(+), 91 deletions(-) diff --git a/core/array/pack/j_spec.rb b/core/array/pack/j_spec.rb index d09d3d6a57..09fb69c854 100644 --- a/core/array/pack/j_spec.rb +++ b/core/array/pack/j_spec.rb @@ -5,9 +5,7 @@ require File.expand_path('../shared/integer', __FILE__) ruby_version_is '2.3' do - platform_is wordsize: 64 do - describe "Array#pack with format 'J'" do it_behaves_like :array_pack_basic, 'J' it_behaves_like :array_pack_basic_non_float, 'J' @@ -25,142 +23,205 @@ end platform_is_not :mingw32 do + describe "Array#pack with format 'J'" do + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_64bit_le, 'J_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_64bit_le, 'J!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_64bit_le, 'J<_' + it_behaves_like :array_pack_64bit_le, 'J_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_64bit_le, 'J' and '_'" do + it_behaves_like :array_pack_64bit_be, 'J>_' + it_behaves_like :array_pack_64bit_be, 'J_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_64bit_be, 'J>!' + it_behaves_like :array_pack_64bit_be, 'J!>' + end + end + + describe "Array#pack with format 'j'" do + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_64bit_le, 'j_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_64bit_le, 'j!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_64bit_le, 'j<_' + it_behaves_like :array_pack_64bit_le, 'j_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_64bit_le, 'j' and '_'" do + it_behaves_like :array_pack_64bit_be, 'j>_' + it_behaves_like :array_pack_64bit_be, 'j_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_64bit_be, 'j>!' + it_behaves_like :array_pack_64bit_be, 'j!>' + end + end + end + + platform_is :mingw32 do + describe "Array#pack with format 'J'" do + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_32bit_le, 'J_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_32bit_le, 'J!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_32bit_le, 'J<_' + it_behaves_like :array_pack_32bit_le, 'J_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_32bit_le, 'J' and '_'" do + it_behaves_like :array_pack_32bit_be, 'J>_' + it_behaves_like :array_pack_32bit_be, 'J_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_32bit_be, 'J>!' + it_behaves_like :array_pack_32bit_be, 'J!>' + end + end + + describe "Array#pack with format 'j'" do + describe "Array#pack with modifier '_'" do + it_behaves_like :array_pack_32bit_le, 'j_' + end + + describe "Array#pack with modifier '!'" do + it_behaves_like :array_pack_32bit_le, 'j!' + end + + describe "Array#pack with modifier '<' and '_'" do + it_behaves_like :array_pack_32bit_le, 'j<_' + it_behaves_like :array_pack_32bit_le, 'j_<' + end + + describe "Array#pack with modifier '<' and '!'" do + it_behaves_like :array_pack_32bit_le, 'j' and '_'" do + it_behaves_like :array_pack_32bit_be, 'j>_' + it_behaves_like :array_pack_32bit_be, 'j_>' + end + + describe "Array#pack with modifier '>' and '!'" do + it_behaves_like :array_pack_32bit_be, 'j>!' + it_behaves_like :array_pack_32bit_be, 'j!>' + end + end + end + end + + platform_is wordsize: 32 do + describe "Array#pack with format 'J'" do + it_behaves_like :array_pack_basic, 'J' + it_behaves_like :array_pack_basic_non_float, 'J' + it_behaves_like :array_pack_arguments, 'J' + it_behaves_like :array_pack_numeric_basic, 'J' + it_behaves_like :array_pack_integer, 'J' + end + describe "Array#pack with format 'j'" do + it_behaves_like :array_pack_basic, 'j' + it_behaves_like :array_pack_basic_non_float, 'j' + it_behaves_like :array_pack_arguments, 'j' + it_behaves_like :array_pack_numeric_basic, 'j' + it_behaves_like :array_pack_integer, 'j' + end + + describe "Array#pack with format 'J'" do describe "Array#pack with modifier '_'" do - it_behaves_like :array_pack_64bit_le, 'J_' - it_behaves_like :array_pack_64bit_le, 'j_' + it_behaves_like :array_pack_32bit_le, 'J_' end describe "Array#pack with modifier '!'" do - it_behaves_like :array_pack_64bit_le, 'J!' - it_behaves_like :array_pack_64bit_le, 'j!' + it_behaves_like :array_pack_32bit_le, 'J!' end describe "Array#pack with modifier '<' and '_'" do - it_behaves_like :array_pack_64bit_le, 'J<_' - it_behaves_like :array_pack_64bit_le, 'J_<' - it_behaves_like :array_pack_64bit_le, 'j<_' - it_behaves_like :array_pack_64bit_le, 'j_<' + it_behaves_like :array_pack_32bit_le, 'J<_' + it_behaves_like :array_pack_32bit_le, 'J_<' end describe "Array#pack with modifier '<' and '!'" do - it_behaves_like :array_pack_64bit_le, 'J' and '_'" do - it_behaves_like :array_pack_64bit_be, 'J>_' - it_behaves_like :array_pack_64bit_be, 'J_>' - it_behaves_like :array_pack_64bit_be, 'j>_' - it_behaves_like :array_pack_64bit_be, 'j_>' + it_behaves_like :array_pack_32bit_be, 'J>_' + it_behaves_like :array_pack_32bit_be, 'J_>' end describe "Array#pack with modifier '>' and '!'" do - it_behaves_like :array_pack_64bit_be, 'J>!' - it_behaves_like :array_pack_64bit_be, 'J!>' - it_behaves_like :array_pack_64bit_be, 'j>!' - it_behaves_like :array_pack_64bit_be, 'j!>' + it_behaves_like :array_pack_32bit_be, 'J>!' + it_behaves_like :array_pack_32bit_be, 'J!>' end end - platform_is :mingw32 do - + describe "Array#pack with format 'j'" do describe "Array#pack with modifier '_'" do - it_behaves_like :array_pack_32bit_le, 'J_' it_behaves_like :array_pack_32bit_le, 'j_' end describe "Array#pack with modifier '!'" do - it_behaves_like :array_pack_32bit_le, 'J!' it_behaves_like :array_pack_32bit_le, 'j!' end describe "Array#pack with modifier '<' and '_'" do - it_behaves_like :array_pack_32bit_le, 'J<_' - it_behaves_like :array_pack_32bit_le, 'J_<' it_behaves_like :array_pack_32bit_le, 'j<_' it_behaves_like :array_pack_32bit_le, 'j_<' end describe "Array#pack with modifier '<' and '!'" do - it_behaves_like :array_pack_32bit_le, 'J' and '_'" do - it_behaves_like :array_pack_32bit_be, 'J>_' - it_behaves_like :array_pack_32bit_be, 'J_>' it_behaves_like :array_pack_32bit_be, 'j>_' it_behaves_like :array_pack_32bit_be, 'j_>' end describe "Array#pack with modifier '>' and '!'" do - it_behaves_like :array_pack_32bit_be, 'J>!' - it_behaves_like :array_pack_32bit_be, 'J!>' it_behaves_like :array_pack_32bit_be, 'j>!' it_behaves_like :array_pack_32bit_be, 'j!>' end end end - - platform_is wordsize: 32 do - - describe "Array#pack with format 'J'" do - it_behaves_like :array_pack_basic, 'J' - it_behaves_like :array_pack_basic_non_float, 'J' - it_behaves_like :array_pack_arguments, 'J' - it_behaves_like :array_pack_numeric_basic, 'J' - it_behaves_like :array_pack_integer, 'J' - end - - describe "Array#pack with format 'j'" do - it_behaves_like :array_pack_basic, 'j' - it_behaves_like :array_pack_basic_non_float, 'j' - it_behaves_like :array_pack_arguments, 'j' - it_behaves_like :array_pack_numeric_basic, 'j' - it_behaves_like :array_pack_integer, 'j' - end - - describe "Array#pack with modifier '_'" do - it_behaves_like :array_pack_32bit_le, 'J_' - it_behaves_like :array_pack_32bit_le, 'j_' - end - - describe "Array#pack with modifier '!'" do - it_behaves_like :array_pack_32bit_le, 'J!' - it_behaves_like :array_pack_32bit_le, 'j!' - end - - describe "Array#pack with modifier '<' and '_'" do - it_behaves_like :array_pack_32bit_le, 'J<_' - it_behaves_like :array_pack_32bit_le, 'J_<' - it_behaves_like :array_pack_32bit_le, 'j<_' - it_behaves_like :array_pack_32bit_le, 'j_<' - end - - describe "Array#pack with modifier '<' and '!'" do - it_behaves_like :array_pack_32bit_le, 'J' and '_'" do - it_behaves_like :array_pack_32bit_be, 'J>_' - it_behaves_like :array_pack_32bit_be, 'J_>' - it_behaves_like :array_pack_32bit_be, 'j>_' - it_behaves_like :array_pack_32bit_be, 'j_>' - end - - describe "Array#pack with modifier '>' and '!'" do - it_behaves_like :array_pack_32bit_be, 'J>!' - it_behaves_like :array_pack_32bit_be, 'J!>' - it_behaves_like :array_pack_32bit_be, 'j>!' - it_behaves_like :array_pack_32bit_be, 'j!>' - end - end end From 4b7352399d526986c1795727933d6f75dbf52b64 Mon Sep 17 00:00:00 2001 From: mjago Date: Thu, 20 Oct 2016 21:23:00 +0100 Subject: [PATCH 5/5] More formatting --- core/array/pack/j_spec.rb | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/core/array/pack/j_spec.rb b/core/array/pack/j_spec.rb index 09fb69c854..3a7aadeaf0 100644 --- a/core/array/pack/j_spec.rb +++ b/core/array/pack/j_spec.rb @@ -24,60 +24,60 @@ platform_is_not :mingw32 do describe "Array#pack with format 'J'" do - describe "Array#pack with modifier '_'" do + describe "with modifier '_'" do it_behaves_like :array_pack_64bit_le, 'J_' end - describe "Array#pack with modifier '!'" do + describe "with modifier '!'" do it_behaves_like :array_pack_64bit_le, 'J!' end - describe "Array#pack with modifier '<' and '_'" do + describe "with modifier '<' and '_'" do it_behaves_like :array_pack_64bit_le, 'J<_' it_behaves_like :array_pack_64bit_le, 'J_<' end - describe "Array#pack with modifier '<' and '!'" do + describe "with modifier '<' and '!'" do it_behaves_like :array_pack_64bit_le, 'J' and '_'" do + describe "with modifier '>' and '_'" do it_behaves_like :array_pack_64bit_be, 'J>_' it_behaves_like :array_pack_64bit_be, 'J_>' end - describe "Array#pack with modifier '>' and '!'" do + describe "with modifier '>' and '!'" do it_behaves_like :array_pack_64bit_be, 'J>!' it_behaves_like :array_pack_64bit_be, 'J!>' end end describe "Array#pack with format 'j'" do - describe "Array#pack with modifier '_'" do + describe "with modifier '_'" do it_behaves_like :array_pack_64bit_le, 'j_' end - describe "Array#pack with modifier '!'" do + describe "with modifier '!'" do it_behaves_like :array_pack_64bit_le, 'j!' end - describe "Array#pack with modifier '<' and '_'" do + describe "with modifier '<' and '_'" do it_behaves_like :array_pack_64bit_le, 'j<_' it_behaves_like :array_pack_64bit_le, 'j_<' end - describe "Array#pack with modifier '<' and '!'" do + describe "with modifier '<' and '!'" do it_behaves_like :array_pack_64bit_le, 'j' and '_'" do + describe "with modifier '>' and '_'" do it_behaves_like :array_pack_64bit_be, 'j>_' it_behaves_like :array_pack_64bit_be, 'j_>' end - describe "Array#pack with modifier '>' and '!'" do + describe "with modifier '>' and '!'" do it_behaves_like :array_pack_64bit_be, 'j>!' it_behaves_like :array_pack_64bit_be, 'j!>' end @@ -86,60 +86,60 @@ platform_is :mingw32 do describe "Array#pack with format 'J'" do - describe "Array#pack with modifier '_'" do + describe "with modifier '_'" do it_behaves_like :array_pack_32bit_le, 'J_' end - describe "Array#pack with modifier '!'" do + describe "with modifier '!'" do it_behaves_like :array_pack_32bit_le, 'J!' end - describe "Array#pack with modifier '<' and '_'" do + describe "with modifier '<' and '_'" do it_behaves_like :array_pack_32bit_le, 'J<_' it_behaves_like :array_pack_32bit_le, 'J_<' end - describe "Array#pack with modifier '<' and '!'" do + describe "with modifier '<' and '!'" do it_behaves_like :array_pack_32bit_le, 'J' and '_'" do + describe "with modifier '>' and '_'" do it_behaves_like :array_pack_32bit_be, 'J>_' it_behaves_like :array_pack_32bit_be, 'J_>' end - describe "Array#pack with modifier '>' and '!'" do + describe "with modifier '>' and '!'" do it_behaves_like :array_pack_32bit_be, 'J>!' it_behaves_like :array_pack_32bit_be, 'J!>' end end describe "Array#pack with format 'j'" do - describe "Array#pack with modifier '_'" do + describe "with modifier '_'" do it_behaves_like :array_pack_32bit_le, 'j_' end - describe "Array#pack with modifier '!'" do + describe "with modifier '!'" do it_behaves_like :array_pack_32bit_le, 'j!' end - describe "Array#pack with modifier '<' and '_'" do + describe "with modifier '<' and '_'" do it_behaves_like :array_pack_32bit_le, 'j<_' it_behaves_like :array_pack_32bit_le, 'j_<' end - describe "Array#pack with modifier '<' and '!'" do + describe "with modifier '<' and '!'" do it_behaves_like :array_pack_32bit_le, 'j' and '_'" do + describe "with modifier '>' and '_'" do it_behaves_like :array_pack_32bit_be, 'j>_' it_behaves_like :array_pack_32bit_be, 'j_>' end - describe "Array#pack with modifier '>' and '!'" do + describe "with modifier '>' and '!'" do it_behaves_like :array_pack_32bit_be, 'j>!' it_behaves_like :array_pack_32bit_be, 'j!>' end @@ -165,60 +165,60 @@ end describe "Array#pack with format 'J'" do - describe "Array#pack with modifier '_'" do + describe "with modifier '_'" do it_behaves_like :array_pack_32bit_le, 'J_' end - describe "Array#pack with modifier '!'" do + describe "with modifier '!'" do it_behaves_like :array_pack_32bit_le, 'J!' end - describe "Array#pack with modifier '<' and '_'" do + describe "with modifier '<' and '_'" do it_behaves_like :array_pack_32bit_le, 'J<_' it_behaves_like :array_pack_32bit_le, 'J_<' end - describe "Array#pack with modifier '<' and '!'" do + describe "with modifier '<' and '!'" do it_behaves_like :array_pack_32bit_le, 'J' and '_'" do + describe "with modifier '>' and '_'" do it_behaves_like :array_pack_32bit_be, 'J>_' it_behaves_like :array_pack_32bit_be, 'J_>' end - describe "Array#pack with modifier '>' and '!'" do + describe "with modifier '>' and '!'" do it_behaves_like :array_pack_32bit_be, 'J>!' it_behaves_like :array_pack_32bit_be, 'J!>' end end describe "Array#pack with format 'j'" do - describe "Array#pack with modifier '_'" do + describe "with modifier '_'" do it_behaves_like :array_pack_32bit_le, 'j_' end - describe "Array#pack with modifier '!'" do + describe "with modifier '!'" do it_behaves_like :array_pack_32bit_le, 'j!' end - describe "Array#pack with modifier '<' and '_'" do + describe "with modifier '<' and '_'" do it_behaves_like :array_pack_32bit_le, 'j<_' it_behaves_like :array_pack_32bit_le, 'j_<' end - describe "Array#pack with modifier '<' and '!'" do + describe "with modifier '<' and '!'" do it_behaves_like :array_pack_32bit_le, 'j' and '_'" do + describe "with modifier '>' and '_'" do it_behaves_like :array_pack_32bit_be, 'j>_' it_behaves_like :array_pack_32bit_be, 'j_>' end - describe "Array#pack with modifier '>' and '!'" do + describe "with modifier '>' and '!'" do it_behaves_like :array_pack_32bit_be, 'j>!' it_behaves_like :array_pack_32bit_be, 'j!>' end