aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_platform.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-09-28 12:12:13 +0200
committergit <svn-admin@ruby-lang.org>2022-10-01 05:46:40 +0900
commit8252ea214061e1e8601ecfe178d010ed92ee8600 (patch)
tree9511e8be9e600e3664b3eb8e76c3ad067ec02887 /test/rubygems/test_gem_platform.rb
parent4d58ee3de0ecf8a3b3201359f3c593142cf92d7b (diff)
downloadruby-8252ea214061e1e8601ecfe178d010ed92ee8600.tar.gz
[rubygems/rubygems] Fix matching of linux platforms with eabi modifiers
https://github.com/rubygems/rubygems/commit/89362c18ef Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
Diffstat (limited to 'test/rubygems/test_gem_platform.rb')
-rw-r--r--test/rubygems/test_gem_platform.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_platform.rb b/test/rubygems/test_gem_platform.rb
index 3bd4a862c5..03417d755a 100644
--- a/test/rubygems/test_gem_platform.rb
+++ b/test/rubygems/test_gem_platform.rb
@@ -333,6 +333,26 @@ class TestGemPlatform < Gem::TestCase
refute(arm_linux_uclibceabi === arm_linux_eabi, "linux-uclibceabi =~ linux-eabi")
end
+ def test_eabi_and_nil_version_combination_strictness
+ arm_linux = Gem::Platform.new "arm-linux"
+ arm_linux_eabi = Gem::Platform.new "arm-linux-eabi"
+ arm_linux_gnueabi = Gem::Platform.new "arm-linux-gnueabi"
+ arm_linux_musleabi = Gem::Platform.new "arm-linux-musleabi"
+ arm_linux_uclibceabi = Gem::Platform.new "arm-linux-uclibceabi"
+
+ # generic arm host runtime with eabi modifier accepts generic arm gems
+ assert(arm_linux === arm_linux_eabi, "arm-linux =~ arm-linux-eabi")
+
+ # explicit gnu arm host runtime with eabi modifier accepts generic arm gems
+ assert(arm_linux === arm_linux_gnueabi, "arm-linux =~ arm-linux-gnueabi")
+
+ # musl arm host runtime accepts libc-generic or statically linked gems...
+ assert(arm_linux === arm_linux_musleabi, "arm-linux =~ arm-linux-musleabi")
+
+ # other libc arm hosts are not glibc compatible
+ refute(arm_linux === arm_linux_uclibceabi, "arm-linux =~ arm-linux-uclibceabi")
+ end
+
def test_equals3_cpu_arm
arm = Gem::Platform.new "arm-linux"
armv5 = Gem::Platform.new "armv5-linux"