aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ruby-concurrent-test-arm.patch
blob: 06d56578147dfc14c5b6393692968c337eefc3e1 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Work around two test suite failures on ARM:

  https://github.com/ruby-concurrency/concurrent-ruby/issues/547

The regexps here assume addresses like "0x1234" but on ARM (32-bit)
we get something like "0x-7db1e810" (notice the dash).

diff --git a/spec/concurrent/edge/promises_spec.rb b/spec/concurrent/edge/promises_spec.rb
index 727210f..149f7cd 100644
--- a/spec/concurrent/edge/promises_spec.rb
+++ b/spec/concurrent/edge/promises_spec.rb
@@ -371,9 +371,9 @@ describe 'Concurrent::Promises' do
       four  = three.delay.then(&:succ)
 
       # meaningful to_s and inspect defined for Future and Promise
-      expect(head.to_s).to match /<#Concurrent::Promises::Future:0x[\da-f]+ pending>/
+      expect(head.to_s).to match /<#Concurrent::Promises::Future:0x-?[\da-f]+ pending>/
       expect(head.inspect).to(
-          match(/<#Concurrent::Promises::Future:0x[\da-f]+ pending>/))
+          match(/<#Concurrent::Promises::Future:0x-?[\da-f]+ pending>/))
 
       # evaluates only up to three, four is left unevaluated
       expect(three.value!).to eq 3
diff --git a/spec/concurrent/map_spec.rb b/spec/concurrent/map_spec.rb
index c4050be..0a9095d 100644
--- a/spec/concurrent/map_spec.rb
+++ b/spec/concurrent/map_spec.rb
@@ -794,7 +794,7 @@ module Concurrent
     end
 
     it '#inspect' do
-      regexp = /\A#<Concurrent::Map:0x[0-9a-f]+ entries=[0-9]+ default_proc=.*>\Z/i
+      regexp = /\A#<Concurrent::Map:0x-?[0-9a-f]+ entries=[0-9]+ default_proc=.*>\Z/i
       expect(Concurrent::Map.new.inspect).to match(regexp)
       expect((Concurrent::Map.new {}).inspect).to match(regexp)
       map = Concurrent::Map.new