diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-27 12:10:41 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-07-27 12:10:41 +0000 |
commit | 0cb5fa5877f7b00d1396e0dda4156e8213d37215 (patch) | |
tree | 98225086822c74e28a61a308f8999a627bf182ae /spec/rubyspec/core/array | |
parent | 819977e4106c64efbcee608300dfe419903c104c (diff) |
Update to ruby/spec@c3e6b90
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec/core/array')
-rw-r--r-- | spec/rubyspec/core/array/pack/j_spec.rb | 4 | ||||
-rw-r--r-- | spec/rubyspec/core/array/pack/l_spec.rb | 216 |
2 files changed, 66 insertions, 154 deletions
diff --git a/spec/rubyspec/core/array/pack/j_spec.rb b/spec/rubyspec/core/array/pack/j_spec.rb index 6c68a6e8df..88f074724c 100644 --- a/spec/rubyspec/core/array/pack/j_spec.rb +++ b/spec/rubyspec/core/array/pack/j_spec.rb @@ -8,7 +8,7 @@ ruby_version_is '2.3' do # To handle the special case of x64-mingw32 pointer_size = RUBY_PLATFORM =~ /\bx64\b/ ? 64 : 1.size * 8 - if pointer_size == 64 then + guard -> { pointer_size == 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' @@ -114,7 +114,7 @@ ruby_version_is '2.3' do end end - if pointer_size == 32 then + guard -> { pointer_size == 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' diff --git a/spec/rubyspec/core/array/pack/l_spec.rb b/spec/rubyspec/core/array/pack/l_spec.rb index 8066b23e90..5c1ad21d12 100644 --- a/spec/rubyspec/core/array/pack/l_spec.rb +++ b/spec/rubyspec/core/array/pack/l_spec.rb @@ -29,7 +29,7 @@ describe "Array#pack with format 'L'" do it_behaves_like :array_pack_32bit_be, '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 :array_pack_32bit_le, 'L<_' it_behaves_like :array_pack_32bit_le, 'L_<' @@ -51,49 +51,25 @@ describe "Array#pack with format 'L'" do end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :array_pack_64bit_le, 'L<_' - it_behaves_like :array_pack_64bit_le, 'L_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :array_pack_64bit_le, 'L<!' - it_behaves_like :array_pack_64bit_le, 'L!<' - end - - describe "with modifier '>' and '_'" do - it_behaves_like :array_pack_64bit_be, 'L>_' - it_behaves_like :array_pack_64bit_be, 'L_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :array_pack_64bit_be, 'L>!' - it_behaves_like :array_pack_64bit_be, 'L!>' - end - end - - platform_is :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :array_pack_32bit_le, 'L<_' - it_behaves_like :array_pack_32bit_le, 'L_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :array_pack_32bit_le, 'L<!' - it_behaves_like :array_pack_32bit_le, 'L!<' - end - - describe "with modifier '>' and '_'" do - it_behaves_like :array_pack_32bit_be, 'L>_' - it_behaves_like :array_pack_32bit_be, 'L_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :array_pack_32bit_be, 'L>!' - it_behaves_like :array_pack_32bit_be, 'L!>' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "with modifier '<' and '_'" do + it_behaves_like :array_pack_64bit_le, 'L<_' + it_behaves_like :array_pack_64bit_le, 'L_<' + end + + describe "with modifier '<' and '!'" do + it_behaves_like :array_pack_64bit_le, 'L<!' + it_behaves_like :array_pack_64bit_le, 'L!<' + end + + describe "with modifier '>' and '_'" do + it_behaves_like :array_pack_64bit_be, 'L>_' + it_behaves_like :array_pack_64bit_be, 'L_>' + end + + describe "with modifier '>' and '!'" do + it_behaves_like :array_pack_64bit_be, 'L>!' + it_behaves_like :array_pack_64bit_be, 'L!>' end end end @@ -107,7 +83,7 @@ describe "Array#pack with format 'l'" do it_behaves_like :array_pack_32bit_be, '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 :array_pack_32bit_le, 'l<_' it_behaves_like :array_pack_32bit_le, 'l_<' @@ -129,49 +105,25 @@ describe "Array#pack with format 'l'" do end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :array_pack_64bit_le, 'l<_' - it_behaves_like :array_pack_64bit_le, 'l_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :array_pack_64bit_le, 'l<!' - it_behaves_like :array_pack_64bit_le, 'l!<' - end - - describe "with modifier '>' and '_'" do - it_behaves_like :array_pack_64bit_be, 'l>_' - it_behaves_like :array_pack_64bit_be, 'l_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :array_pack_64bit_be, 'l>!' - it_behaves_like :array_pack_64bit_be, 'l!>' - end - end - - platform_is :mingw32 do - describe "with modifier '<' and '_'" do - it_behaves_like :array_pack_32bit_le, 'l<_' - it_behaves_like :array_pack_32bit_le, 'l_<' - end - - describe "with modifier '<' and '!'" do - it_behaves_like :array_pack_32bit_le, 'l<!' - it_behaves_like :array_pack_32bit_le, 'l!<' - end - - describe "with modifier '>' and '_'" do - it_behaves_like :array_pack_32bit_be, 'l>_' - it_behaves_like :array_pack_32bit_be, 'l_>' - end - - describe "with modifier '>' and '!'" do - it_behaves_like :array_pack_32bit_be, 'l>!' - it_behaves_like :array_pack_32bit_be, 'l!>' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "with modifier '<' and '_'" do + it_behaves_like :array_pack_64bit_le, 'l<_' + it_behaves_like :array_pack_64bit_le, 'l_<' + end + + describe "with modifier '<' and '!'" do + it_behaves_like :array_pack_64bit_le, 'l<!' + it_behaves_like :array_pack_64bit_le, 'l!<' + end + + describe "with modifier '>' and '_'" do + it_behaves_like :array_pack_64bit_be, 'l>_' + it_behaves_like :array_pack_64bit_be, 'l_>' + end + + describe "with modifier '>' and '!'" do + it_behaves_like :array_pack_64bit_be, 'l>!' + it_behaves_like :array_pack_64bit_be, 'l!>' end end end @@ -185,7 +137,7 @@ little_endian do it_behaves_like :array_pack_32bit_le, 'l' end - platform_is wordsize: 32 do + guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do describe "Array#pack with format 'L' with modifier '_'" do it_behaves_like :array_pack_32bit_le, 'L_' end @@ -203,41 +155,21 @@ little_endian do end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "Array#pack with format 'L' with modifier '_'" do - it_behaves_like :array_pack_64bit_le, 'L_' - end - - describe "Array#pack with format 'L' with modifier '!'" do - it_behaves_like :array_pack_64bit_le, 'L!' - end - - describe "Array#pack with format 'l' with modifier '_'" do - it_behaves_like :array_pack_64bit_le, 'l_' - end - - describe "Array#pack with format 'l' with modifier '!'" do - it_behaves_like :array_pack_64bit_le, 'l!' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "Array#pack with format 'L' with modifier '_'" do + it_behaves_like :array_pack_64bit_le, 'L_' end - platform_is :mingw32 do - describe "Array#pack with format 'L' with modifier '_'" do - it_behaves_like :array_pack_32bit_le, 'L_' - end - - describe "Array#pack with format 'L' with modifier '!'" do - it_behaves_like :array_pack_32bit_le, 'L!' - end + describe "Array#pack with format 'L' with modifier '!'" do + it_behaves_like :array_pack_64bit_le, 'L!' + end - describe "Array#pack with format 'l' with modifier '_'" do - it_behaves_like :array_pack_32bit_le, 'l_' - end + describe "Array#pack with format 'l' with modifier '_'" do + it_behaves_like :array_pack_64bit_le, 'l_' + end - describe "Array#pack with format 'l' with modifier '!'" do - it_behaves_like :array_pack_32bit_le, 'l!' - end + describe "Array#pack with format 'l' with modifier '!'" do + it_behaves_like :array_pack_64bit_le, 'l!' end end end @@ -251,7 +183,7 @@ big_endian do it_behaves_like :array_pack_32bit_be, 'l' end - platform_is wordsize: 32 do + guard -> { platform_is wordsize: 32 or platform_is :mingw32 } do describe "Array#pack with format 'L' with modifier '_'" do it_behaves_like :array_pack_32bit_be, 'L_' end @@ -269,41 +201,21 @@ big_endian do end end - platform_is wordsize: 64 do - platform_is_not :mingw32 do - describe "Array#pack with format 'L' with modifier '_'" do - it_behaves_like :array_pack_64bit_be, 'L_' - end - - describe "Array#pack with format 'L' with modifier '!'" do - it_behaves_like :array_pack_64bit_be, 'L!' - end - - describe "Array#pack with format 'l' with modifier '_'" do - it_behaves_like :array_pack_64bit_be, 'l_' - end - - describe "Array#pack with format 'l' with modifier '!'" do - it_behaves_like :array_pack_64bit_be, 'l!' - end + guard -> { platform_is wordsize: 64 and platform_is_not :mingw32 } do + describe "Array#pack with format 'L' with modifier '_'" do + it_behaves_like :array_pack_64bit_be, 'L_' end - platform_is :mingw32 do - describe "Array#pack with format 'L' with modifier '_'" do - it_behaves_like :array_pack_32bit_be, 'L_' - end - - describe "Array#pack with format 'L' with modifier '!'" do - it_behaves_like :array_pack_32bit_be, 'L!' - end + describe "Array#pack with format 'L' with modifier '!'" do + it_behaves_like :array_pack_64bit_be, 'L!' + end - describe "Array#pack with format 'l' with modifier '_'" do - it_behaves_like :array_pack_32bit_be, 'l_' - end + describe "Array#pack with format 'l' with modifier '_'" do + it_behaves_like :array_pack_64bit_be, 'l_' + end - describe "Array#pack with format 'l' with modifier '!'" do - it_behaves_like :array_pack_32bit_be, 'l!' - end + describe "Array#pack with format 'l' with modifier '!'" do + it_behaves_like :array_pack_64bit_be, 'l!' end end end |