Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 46f8aaca4b84
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1df58b54c183
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 11, 2016

  1. Copy the full SHA
    3e6e3fc View commit details
  2. Copy the full SHA
    9a000cd View commit details
  3. Copy the full SHA
    1df58b5 View commit details
Showing with 39 additions and 0 deletions.
  1. +22 −0 spec/jrubyc/java/files/double_rescue.rb
  2. +7 −0 spec/jrubyc/java/files/symbol_proc.rb
  3. +10 −0 spec/jrubyc/java/loading_spec.rb
22 changes: 22 additions & 0 deletions spec/jrubyc/java/files/double_rescue.rb
Original file line number Diff line number Diff line change
@@ -6,4 +6,26 @@ def _call
rescue => e
e || 2 # doesn't matter
end

nil.to_x rescue nil

def self.re_raise_return
begin
load 'MISSING FILE.TMP'
rescue LoadError => e
raise e
end
rescue ScriptError
return $!
end

def self.re_raise
begin
load 'MISSING FILE.TMP'
rescue Exception => e
raise e
end
rescue => e
return $! || e # no reached
end
end
7 changes: 7 additions & 0 deletions spec/jrubyc/java/files/symbol_proc.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
map_lambda = lambda do |arr, method|
return arr.map(&method.to_sym)
end

arr = [ '1', '2', '3' ]; arr.map! { |e| e * e.to_i }

$symbol_proc_result = map_lambda.call(arr, :size)
10 changes: 10 additions & 0 deletions spec/jrubyc/java/loading_spec.rb
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ def compile_files(files)

expect( defined?(DoubleRescue) ).to be_truthy
DoubleRescue.new._call

expect( DoubleRescue.re_raise_return ).to be_a LoadError
expect { DoubleRescue.re_raise }.to raise_error LoadError
end

it "loads sample_block.class" do
@@ -36,4 +39,11 @@ def compile_files(files)
expect( SampleBlock.class_variable_get :@@func ).to eql '11'
end

it "deserializes symbol_proc.class" do
load File.join(FILES_DIR, 'symbol_proc.class')

expect( $symbol_proc_result ).to be_truthy
expect( $symbol_proc_result ).to eql [ 1, 2, 3 ]
end

end