File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ slow:Truffle::SynchronizedArray redefines all Array and Enumerable methods
Original file line number Diff line number Diff line change
1
+ # truffleruby_primitives: true
2
+
3
+ # Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. This
4
+ # code is released under a tri EPL/GPL/LGPL license. You can use it,
5
+ # redistribute it and/or modify it under the terms of the:
6
+ #
7
+ # Eclipse Public License version 2.0, or
8
+ # GNU General Public License version 2, or
9
+ # GNU Lesser General Public License version 2.1.
10
+
11
+ require_relative '../ruby/spec_helper'
12
+
13
+ describe "Truffle::SynchronizedArray" do
14
+ it "redefines all Array and Enumerable methods" do
15
+ expected_methods = ruby_exe ( "puts Array.public_instance_methods(false) + Enumerable.public_instance_methods(false)" )
16
+ expected_methods = expected_methods . lines ( chomp : true ) . map { |line | line . to_sym } . uniq! . sort!
17
+ synchronized_methods = Truffle ::SynchronizedArray . public_instance_methods ( false ) . sort!
18
+
19
+ if synchronized_methods == expected_methods
20
+ synchronized_methods . should == synchronized_methods
21
+ else
22
+ # if the fast check fails, do a slower check to determine why
23
+ expected_methods . each do |m |
24
+ synchronized_methods . should include ( m )
25
+ end
26
+ synchronized_methods . each do |m |
27
+ expected_methods . should include ( m )
28
+ end
29
+ end
30
+ end
31
+ end
You can’t perform that action at this time.
0 commit comments