diff --git a/core/string/unpack/l_spec.rb b/core/string/unpack/l_spec.rb index 3a7c55f8da..11f0648fc7 100644 --- a/core/string/unpack/l_spec.rb +++ b/core/string/unpack/l_spec.rb @@ -14,7 +14,7 @@ it_behaves_like :string_unpack_32bit_be_unsigned, 'L>' end - platform_is wordsize: 32 do + guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do describe "with modifier '<' and '_'" do it_behaves_like :string_unpack_32bit_le, 'L<_' it_behaves_like :string_unpack_32bit_le, 'L_<' @@ -44,65 +44,33 @@ end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :string_unpack_64bit_le, 'L<_' - it_behaves_like :string_unpack_64bit_le, 'L_<' - it_behaves_like :string_unpack_64bit_le_unsigned, 'L<_' - it_behaves_like :string_unpack_64bit_le_unsigned, 'L_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :string_unpack_64bit_le, 'L' and '_'" do - it_behaves_like :string_unpack_64bit_be, 'L>_' - it_behaves_like :string_unpack_64bit_be, 'L_>' - it_behaves_like :string_unpack_64bit_be_unsigned, 'L>_' - it_behaves_like :string_unpack_64bit_be_unsigned, 'L_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :string_unpack_64bit_be, 'L>!' - it_behaves_like :string_unpack_64bit_be, 'L!>' - it_behaves_like :string_unpack_64bit_be_unsigned, 'L>!' - it_behaves_like :string_unpack_64bit_be_unsigned, 'L!>' - end - end - - platform_is :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :string_unpack_32bit_le, 'L<_' - it_behaves_like :string_unpack_32bit_le, 'L_<' - it_behaves_like :string_unpack_32bit_le_unsigned, 'L<_' - it_behaves_like :string_unpack_32bit_le_unsigned, 'L_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :string_unpack_32bit_le, 'L' and '_'" do - it_behaves_like :string_unpack_32bit_be, 'L>_' - it_behaves_like :string_unpack_32bit_be, 'L_>' - it_behaves_like :string_unpack_32bit_be_unsigned, 'L>_' - it_behaves_like :string_unpack_32bit_be_unsigned, 'L_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :string_unpack_32bit_be, 'L>!' - it_behaves_like :string_unpack_32bit_be, 'L!>' - it_behaves_like :string_unpack_32bit_be_unsigned, 'L>!' - it_behaves_like :string_unpack_32bit_be_unsigned, 'L!>' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "with modifier '<' and '_'" do + it_behaves_like :string_unpack_64bit_le, 'L<_' + it_behaves_like :string_unpack_64bit_le, 'L_<' + it_behaves_like :string_unpack_64bit_le_unsigned, 'L<_' + it_behaves_like :string_unpack_64bit_le_unsigned, 'L_<' + end + + describe "with modifier '<' and '!'" do + it_behaves_like :string_unpack_64bit_le, 'L' and '_'" do + it_behaves_like :string_unpack_64bit_be, 'L>_' + it_behaves_like :string_unpack_64bit_be, 'L_>' + it_behaves_like :string_unpack_64bit_be_unsigned, 'L>_' + it_behaves_like :string_unpack_64bit_be_unsigned, 'L_>' + end + + describe "with modifier '>' and '!'" do + it_behaves_like :string_unpack_64bit_be, 'L>!' + it_behaves_like :string_unpack_64bit_be, 'L!>' + it_behaves_like :string_unpack_64bit_be_unsigned, 'L>!' + it_behaves_like :string_unpack_64bit_be_unsigned, 'L!>' end end end @@ -118,7 +86,7 @@ it_behaves_like :string_unpack_32bit_be_signed, 'l>' end - platform_is wordsize: 32 do + guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do describe "with modifier '<' and '_'" do it_behaves_like :string_unpack_32bit_le, 'l<_' it_behaves_like :string_unpack_32bit_le, 'l_<' @@ -148,65 +116,33 @@ end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :string_unpack_64bit_le, 'l<_' - it_behaves_like :string_unpack_64bit_le, 'l_<' - it_behaves_like :string_unpack_64bit_le_signed, 'l<_' - it_behaves_like :string_unpack_64bit_le_signed, 'l_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :string_unpack_64bit_le, 'l' and '_'" do - it_behaves_like :string_unpack_64bit_be, 'l>_' - it_behaves_like :string_unpack_64bit_be, 'l_>' - it_behaves_like :string_unpack_64bit_be_signed, 'l>_' - it_behaves_like :string_unpack_64bit_be_signed, 'l_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :string_unpack_64bit_be, 'l>!' - it_behaves_like :string_unpack_64bit_be, 'l!>' - it_behaves_like :string_unpack_64bit_be_signed, 'l>!' - it_behaves_like :string_unpack_64bit_be_signed, 'l!>' - end - end - - platform_is :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :string_unpack_32bit_le, 'l<_' - it_behaves_like :string_unpack_32bit_le, 'l_<' - it_behaves_like :string_unpack_32bit_le_signed, 'l<_' - it_behaves_like :string_unpack_32bit_le_signed, 'l_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :string_unpack_32bit_le, 'l' and '_'" do - it_behaves_like :string_unpack_32bit_be, 'l>_' - it_behaves_like :string_unpack_32bit_be, 'l_>' - it_behaves_like :string_unpack_32bit_be_signed, 'l>_' - it_behaves_like :string_unpack_32bit_be_signed, 'l_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :string_unpack_32bit_be, 'l>!' - it_behaves_like :string_unpack_32bit_be, 'l!>' - it_behaves_like :string_unpack_32bit_be_signed, 'l>!' - it_behaves_like :string_unpack_32bit_be_signed, 'l!>' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "with modifier '<' and '_'" do + it_behaves_like :string_unpack_64bit_le, 'l<_' + it_behaves_like :string_unpack_64bit_le, 'l_<' + it_behaves_like :string_unpack_64bit_le_signed, 'l<_' + it_behaves_like :string_unpack_64bit_le_signed, 'l_<' + end + + describe "with modifier '<' and '!'" do + it_behaves_like :string_unpack_64bit_le, 'l' and '_'" do + it_behaves_like :string_unpack_64bit_be, 'l>_' + it_behaves_like :string_unpack_64bit_be, 'l_>' + it_behaves_like :string_unpack_64bit_be_signed, 'l>_' + it_behaves_like :string_unpack_64bit_be_signed, 'l_>' + end + + describe "with modifier '>' and '!'" do + it_behaves_like :string_unpack_64bit_be, 'l>!' + it_behaves_like :string_unpack_64bit_be, 'l!>' + it_behaves_like :string_unpack_64bit_be_signed, 'l>!' + it_behaves_like :string_unpack_64bit_be_signed, 'l!>' end end end @@ -224,7 +160,7 @@ it_behaves_like :string_unpack_32bit_le_signed, 'l' end - platform_is wordsize: 32 do + guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do describe "String#unpack with format 'L' with modifier '_'" do it_behaves_like :string_unpack_32bit_le, 'L_' it_behaves_like :string_unpack_32bit_le_unsigned, 'L_' @@ -246,49 +182,25 @@ end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "String#unpack with format 'L' with modifier '_'" do - it_behaves_like :string_unpack_64bit_le, 'L_' - it_behaves_like :string_unpack_64bit_le_unsigned, 'L_' - end - - describe "String#unpack with format 'L' with modifier '!'" do - it_behaves_like :string_unpack_64bit_le, 'L!' - it_behaves_like :string_unpack_64bit_le_unsigned, 'L!' - end - - describe "String#unpack with format 'l' with modifier '_'" do - it_behaves_like :string_unpack_64bit_le, 'l_' - it_behaves_like :string_unpack_64bit_le_signed, 'l_' - end - - describe "String#unpack with format 'l' with modifier '!'" do - it_behaves_like :string_unpack_64bit_le, 'l!' - it_behaves_like :string_unpack_64bit_le_signed, 'l!' - end - end - - platform_is :mingw32 do - describe "String#unpack with format 'L' with modifier '_'" do - it_behaves_like :string_unpack_32bit_le, 'L_' - it_behaves_like :string_unpack_32bit_le_unsigned, 'L_' - end - - describe "String#unpack with format 'L' with modifier '!'" do - it_behaves_like :string_unpack_32bit_le, 'L!' - it_behaves_like :string_unpack_32bit_le_unsigned, 'L!' - end - - describe "String#unpack with format 'l' with modifier '_'" do - it_behaves_like :string_unpack_32bit_le, 'l_' - it_behaves_like :string_unpack_32bit_le_signed, 'l_' - end - - describe "String#unpack with format 'l' with modifier '!'" do - it_behaves_like :string_unpack_32bit_le, 'l!' - it_behaves_like :string_unpack_32bit_le_signed, 'l!' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "String#unpack with format 'L' with modifier '_'" do + it_behaves_like :string_unpack_64bit_le, 'L_' + it_behaves_like :string_unpack_64bit_le_unsigned, 'L_' + end + + describe "String#unpack with format 'L' with modifier '!'" do + it_behaves_like :string_unpack_64bit_le, 'L!' + it_behaves_like :string_unpack_64bit_le_unsigned, 'L!' + end + + describe "String#unpack with format 'l' with modifier '_'" do + it_behaves_like :string_unpack_64bit_le, 'l_' + it_behaves_like :string_unpack_64bit_le_signed, 'l_' + end + + describe "String#unpack with format 'l' with modifier '!'" do + it_behaves_like :string_unpack_64bit_le, 'l!' + it_behaves_like :string_unpack_64bit_le_signed, 'l!' end end end @@ -306,7 +218,7 @@ it_behaves_like :string_unpack_32bit_be_signed, 'l' end - platform_is wordsize: 32 do + guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do describe "String#unpack with format 'L' with modifier '_'" do it_behaves_like :string_unpack_32bit_be, 'L_' it_behaves_like :string_unpack_32bit_be_unsigned, 'L_' @@ -328,49 +240,26 @@ end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "String#unpack with format 'L' with modifier '_'" do - it_behaves_like :string_unpack_64bit_be, 'L_' - it_behaves_like :string_unpack_64bit_be_unsigned, 'L_' - end - - describe "String#unpack with format 'L' with modifier '!'" do - it_behaves_like :string_unpack_64bit_be, 'L!' - it_behaves_like :string_unpack_64bit_be_unsigned, 'L!' - end - - describe "String#unpack with format 'l' with modifier '_'" do - it_behaves_like :string_unpack_64bit_be, 'l_' - it_behaves_like :string_unpack_64bit_be_signed, 'l_' - end - - describe "String#unpack with format 'l' with modifier '!'" do - it_behaves_like :string_unpack_64bit_be, 'l!' - it_behaves_like :string_unpack_64bit_be_signed, 'l!' - end - end - - platform_is :mingw32 do - describe "String#unpack with format 'L' with modifier '_'" do - it_behaves_like :string_unpack_32bit_be, 'L_' - it_behaves_like :string_unpack_32bit_be_unsigned, 'L_' - end - - describe "String#unpack with format 'L' with modifier '!'" do - it_behaves_like :string_unpack_32bit_be, 'L!' - it_behaves_like :string_unpack_32bit_be_unsigned, 'L!' - end - - describe "String#unpack with format 'l' with modifier '_'" do - it_behaves_like :string_unpack_32bit_be, 'l_' - it_behaves_like :string_unpack_32bit_be_signed, 'l_' - end - - describe "String#unpack with format 'l' with modifier '!'" do - it_behaves_like :string_unpack_32bit_be, 'l!' - it_behaves_like :string_unpack_32bit_be_signed, 'l!' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "String#unpack with format 'L' with modifier '_'" do + it_behaves_like :string_unpack_64bit_be, 'L_' + it_behaves_like :string_unpack_64bit_be_unsigned, 'L_' + end + + describe "String#unpack with format 'L' with modifier '!'" do + it_behaves_like :string_unpack_64bit_be, 'L!' + it_behaves_like :string_unpack_64bit_be_unsigned, 'L!' + end + + describe "String#unpack with format 'l' with modifier '_'" do + it_behaves_like :string_unpack_64bit_be, 'l_' + it_behaves_like :string_unpack_64bit_be_signed, 'l_' + end + + describe "String#unpack with format 'l' with modifier '!'" do + it_behaves_like :string_unpack_64bit_be, 'l!' + it_behaves_like :string_unpack_64bit_be_signed, 'l!' end end + end