-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into truffle-head
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
- 9.0.5.0
- 9.0.4.0
- 9.0.3.0
- 9.0.1.0
- 9.0.0.0
- 9.0.0.0.rc2
- 9.0.0.0.rc1
- 9.0.0.0.pre2
- 9.0.0.0.pre1
Showing
72 changed files
with
1,767 additions
and
386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 0 additions & 114 deletions
114
core/src/main/java/org/jruby/runtime/load/CExtension.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
core/src/test/java/org/jruby/lexer/yacc/StringTermTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package org.jruby.lexer.yacc; | ||
|
||
import org.jruby.CompatVersion; | ||
import org.jruby.Ruby; | ||
import org.jruby.RubyInstanceConfig; | ||
import org.jruby.runtime.builtin.IRubyObject; | ||
import org.jruby.util.KCode; | ||
|
||
import junit.framework.TestCase; | ||
|
||
public class StringTermTest extends TestCase { | ||
|
||
/** | ||
* @see https://github.com/jruby/jruby/issues/1069 | ||
*/ | ||
public void testGH1069() { | ||
final String testScriptUsingSingleQuote = "# encoding: utf-8\n'\\’'"; | ||
final String testScriptUsingDoubleQuote = "# encoding: utf-8\n\"\\’\""; | ||
|
||
CompatVersion[] versions = new CompatVersion[] { CompatVersion.RUBY1_8, | ||
CompatVersion.RUBY1_9, CompatVersion.RUBY2_0 }; | ||
|
||
for (CompatVersion v : versions) { | ||
RubyInstanceConfig config = new RubyInstanceConfig(); | ||
config.setCompatVersion(v); | ||
Ruby runtime = Ruby.newInstance(config); | ||
|
||
IRubyObject eval1 = runtime.evalScriptlet(testScriptUsingSingleQuote); | ||
assertEquals("\\’", eval1.toJava(String.class)); | ||
|
||
IRubyObject eval2 = runtime.evalScriptlet(testScriptUsingDoubleQuote); | ||
assertEquals("’", eval2.toJava(String.class)); | ||
} | ||
} | ||
|
||
/** | ||
* @see https://github.com/jruby/jruby/issues/1390 | ||
*/ | ||
public void testGH1390() { | ||
final String testScriptUsingSingleQuote = "# encoding: utf-8\n'\\\\あ'"; | ||
final String testScriptUsingDoubleQuote = "# encoding: utf-8\n\"\\\\あ\""; | ||
|
||
CompatVersion[] versions = new CompatVersion[] { CompatVersion.RUBY1_8, | ||
CompatVersion.RUBY1_9, CompatVersion.RUBY2_0 }; | ||
|
||
for (CompatVersion v : versions) { | ||
RubyInstanceConfig config = new RubyInstanceConfig(); | ||
config.setCompatVersion(v); | ||
Ruby runtime = Ruby.newInstance(config); | ||
|
||
IRubyObject eval1 = runtime.evalScriptlet(testScriptUsingSingleQuote); | ||
assertEquals("\\あ", eval1.toJava(String.class)); | ||
|
||
IRubyObject eval2 = runtime.evalScriptlet(testScriptUsingDoubleQuote); | ||
assertEquals("\\あ", eval2.toJava(String.class)); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
invoker.goals = install | ||
invoker.mavenOpts = -client | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# jruby scripting container | ||
jar 'org.jruby:jruby-core', '@project.version@' | ||
jar 'org.jruby:jruby-stdlib', '@project.version@' | ||
|
||
# unit tests | ||
jar 'junit:junit', '4.8.2', :scope => :test | ||
|
||
properties 'tesla.dump.pom' => 'pom.xml', 'tesla.dump.readOnly' => true | ||
|
||
plugin :surefire, '2.15', :additionalClasspathElements => [ '${basedir}/../../../../../core/target/test-classes', '${basedir}/../../../../../test/target/test-classes' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>no_group_id_given</groupId> | ||
<artifactId>extended</artifactId> | ||
<version>0.0.0</version> | ||
<name>extended</name> | ||
<properties> | ||
<tesla.dump.readOnly>true</tesla.dump.readOnly> | ||
<tesla.dump.pom>pom.xml</tesla.dump.pom> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby-core</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby-stdlib</artifactId> | ||
<version>@project.version@</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.15</version> | ||
<configuration> | ||
<additionalClasspathElements> | ||
<additionalClasspathElement>${basedir}/../../../../../core/target/test-classes</additionalClasspathElement> | ||
<additionalClasspathElement>${basedir}/../../../../../test/target/test-classes</additionalClasspathElement> | ||
</additionalClasspathElements> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
102 changes: 102 additions & 0 deletions
102
maven/jruby-jars/src/it/extended/src/test/java/org/example/SimpleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package org.example; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.util.Arrays; | ||
import java.io.File; | ||
import java.io.StringWriter; | ||
|
||
import org.jruby.embed.LocalContextScope; | ||
import org.jruby.embed.ScriptingContainer; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class SimpleTest { | ||
|
||
private final String basedir = new File( "../../../../../" ).getAbsolutePath(); | ||
|
||
private ScriptingContainer newScriptingContainer() { | ||
ScriptingContainer container = new ScriptingContainer(LocalContextScope.SINGLETHREAD); | ||
container.setCurrentDirectory(basedir); | ||
container.getProvider().getRubyInstanceConfig().setJRubyHome("uri:classloader://META-INF/jruby.home"); | ||
container.getProvider().getRubyInstanceConfig().setLoadPaths(Arrays.asList(".", "test", "test/mri", "test/mri/ruby")); | ||
container.runScriptlet("ENV['GEM_PATH']='lib/ruby/gems/shared'"); | ||
return container; | ||
} | ||
|
||
private void runTests(ScriptingContainer container) throws Exception { | ||
container.getProvider().getRuntime().tearDown(true); | ||
container.terminate(); | ||
} | ||
|
||
private void collectTests(ScriptingContainer container, String index) throws Exception { | ||
container.runScriptlet("File.open(File.join('test', '" + index + ".index')) do |f|\n" + | ||
" f.each_line.each do |line|\n" + | ||
" next if line =~ /^#/ or line.strip.empty?\n" + | ||
" filename = \"test/mri/#{line.chomp}\"\n" + | ||
" filename = \"test/jruby/#{line.chomp}.rb\" unless File.exist? filename\n" + | ||
" filename = \"test/#{line.chomp}.rb\" unless File.exist? filename\n" + | ||
" next unless File.file? filename\n" + | ||
" next if filename =~ /mri\\/net\\/http\\//\n" + | ||
" next if filename =~ /mri\\/ruby\\/test_class/\n" + | ||
" next if filename =~ /mri\\/ruby\\/test_io/\n" + | ||
" next if filename =~ /mri\\/ruby\\/test_econv/\n" + | ||
" next if filename =~ /nru\\/test_open3/\n" + | ||
// TODO file an issue or so | ||
" next if filename =~ /test_load_compiled_ruby.rb/\n" + | ||
// TODO remove the following after fix of #2215 | ||
" next if filename =~ /test_jar_on_load_path.rb/\n" + | ||
" next if filename =~ /test_file.rb/\n" + | ||
" filename.sub!( /.*\\/test\\//, 'test/' )\n" + | ||
" puts filename\n" + | ||
" require filename\n" + | ||
" end\n" + | ||
" end"); | ||
} | ||
|
||
private void runIt(String index) throws Exception { | ||
runIt(index, null); | ||
} | ||
|
||
private void runIt(String index, String script) throws Exception { | ||
ClassLoader cl = Thread.currentThread().getContextClassLoader(); | ||
try { | ||
//Thread.currentThread().setContextClassLoader(); | ||
System.err.println("\n\nrunning --------- " + index + "\n"); | ||
ScriptingContainer container = newScriptingContainer(); | ||
if (script != null) container.runScriptlet( script ); | ||
if (index != null) collectTests(container, index); | ||
runTests(container); | ||
} | ||
finally { | ||
Thread.currentThread().setContextClassLoader(cl); | ||
} | ||
} | ||
|
||
@Test | ||
public void testObjectspace() throws Exception { | ||
runIt("objectspace"); | ||
} | ||
|
||
@Test | ||
public void testSlow() throws Exception { | ||
runIt("slow"); | ||
} | ||
|
||
@Test | ||
public void testMRI() throws Exception { | ||
runIt("mri", "ENV['EXCLUDE_DIR']='test/mri/excludes';"); | ||
} | ||
|
||
@Test | ||
public void testJRuby() throws Exception { | ||
runIt("jruby"); | ||
} | ||
|
||
// @Test | ||
// public void test() throws Exception { | ||
// runIt(null, "require 'test/test_load_compiled_ruby.rb'"); | ||
// } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
invoker.goals = install | ||
invoker.mavenOpts = -client | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# jruby scripting container | ||
pom 'org.jruby:jruby', '@project.version@' | ||
|
||
# unit tests | ||
jar 'junit:junit', '4.8.2', :scope => :test | ||
|
||
properties 'tesla.dump.pom' => 'pom.xml', 'tesla.dump.readOnly' => true | ||
|
||
plugin :surefire, '2.15', :additionalClasspathElements => [ '${basedir}/../../../../../core/target/test-classes', '${basedir}/../../../../../test/target/test-classes' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>no_group_id_given</groupId> | ||
<artifactId>extended</artifactId> | ||
<version>0.0.0</version> | ||
<name>extended</name> | ||
<properties> | ||
<tesla.dump.readOnly>true</tesla.dump.readOnly> | ||
<tesla.dump.pom>pom.xml</tesla.dump.pom> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jruby</groupId> | ||
<artifactId>jruby</artifactId> | ||
<version>@project.version@</version> | ||
<type>pom</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.2</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.15</version> | ||
<configuration> | ||
<additionalClasspathElements> | ||
<additionalClasspathElement>${basedir}/../../../../../core/target/test-classes</additionalClasspathElement> | ||
<additionalClasspathElement>${basedir}/../../../../../test/target/test-classes</additionalClasspathElement> | ||
</additionalClasspathElements> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
102 changes: 102 additions & 0 deletions
102
maven/jruby/src/it/extended/src/test/java/org/example/SimpleTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
package org.example; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.util.Arrays; | ||
import java.io.File; | ||
import java.io.StringWriter; | ||
|
||
import org.jruby.embed.LocalContextScope; | ||
import org.jruby.embed.ScriptingContainer; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class SimpleTest { | ||
|
||
private final String basedir = new File( "../../../../../" ).getAbsolutePath(); | ||
|
||
private ScriptingContainer newScriptingContainer() { | ||
ScriptingContainer container = new ScriptingContainer(LocalContextScope.SINGLETHREAD); | ||
container.setCurrentDirectory(basedir); | ||
container.getProvider().getRubyInstanceConfig().setJRubyHome("uri:classloader://META-INF/jruby.home"); | ||
container.getProvider().getRubyInstanceConfig().setLoadPaths(Arrays.asList(".", "test", "test/mri", "test/mri/ruby")); | ||
container.runScriptlet("ENV['GEM_PATH']='lib/ruby/gems/shared'"); | ||
return container; | ||
} | ||
|
||
private void runTests(ScriptingContainer container) throws Exception { | ||
container.getProvider().getRuntime().tearDown(true); | ||
container.terminate(); | ||
} | ||
|
||
private void collectTests(ScriptingContainer container, String index) throws Exception { | ||
container.runScriptlet("File.open(File.join('test', '" + index + ".index')) do |f|\n" + | ||
" f.each_line.each do |line|\n" + | ||
" next if line =~ /^#/ or line.strip.empty?\n" + | ||
" filename = \"test/mri/#{line.chomp}\"\n" + | ||
" filename = \"test/jruby/#{line.chomp}.rb\" unless File.exist? filename\n" + | ||
" filename = \"test/#{line.chomp}.rb\" unless File.exist? filename\n" + | ||
" next unless File.file? filename\n" + | ||
" next if filename =~ /mri\\/net\\/http\\//\n" + | ||
" next if filename =~ /mri\\/ruby\\/test_class/\n" + | ||
" next if filename =~ /mri\\/ruby\\/test_io/\n" + | ||
" next if filename =~ /mri\\/ruby\\/test_econv/\n" + | ||
" next if filename =~ /nru\\/test_open3/\n" + | ||
// TODO file an issue or so | ||
" next if filename =~ /test_load_compiled_ruby.rb/\n" + | ||
// TODO remove the following after fix of #2215 | ||
" next if filename =~ /test_jar_on_load_path.rb/\n" + | ||
" next if filename =~ /test_file.rb/\n" + | ||
" filename.sub!( /.*\\/test\\//, 'test/' )\n" + | ||
" puts filename\n" + | ||
" require filename\n" + | ||
" end\n" + | ||
" end"); | ||
} | ||
|
||
private void runIt(String index) throws Exception { | ||
runIt(index, null); | ||
} | ||
|
||
private void runIt(String index, String script) throws Exception { | ||
ClassLoader cl = Thread.currentThread().getContextClassLoader(); | ||
try { | ||
//Thread.currentThread().setContextClassLoader(); | ||
System.err.println("\n\nrunning --------- " + index + "\n"); | ||
ScriptingContainer container = newScriptingContainer(); | ||
if (script != null) container.runScriptlet( script ); | ||
if (index != null) collectTests(container, index); | ||
runTests(container); | ||
} | ||
finally { | ||
Thread.currentThread().setContextClassLoader(cl); | ||
} | ||
} | ||
|
||
@Test | ||
public void testObjectspace() throws Exception { | ||
runIt("objectspace"); | ||
} | ||
|
||
@Test | ||
public void testSlow() throws Exception { | ||
runIt("slow"); | ||
} | ||
|
||
@Test | ||
public void testMRI() throws Exception { | ||
runIt("mri", "ENV['EXCLUDE_DIR']='test/mri/excludes';"); | ||
} | ||
|
||
@Test | ||
public void testJRuby() throws Exception { | ||
runIt("jruby"); | ||
} | ||
|
||
// @Test | ||
// public void test() throws Exception { | ||
// runIt(null, "require 'test/test_load_compiled_ruby.rb'"); | ||
// } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
spec/regression/GH-1695_bigdecimal_and_rational_multiplication_rounds_the_rational_number.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
require 'rational' | ||
require 'bigdecimal' | ||
|
||
# https://github.com/jruby/jruby/issues/1695 | ||
describe 'BigDecimal#*' do | ||
it 'returns correct value' do | ||
(BigDecimal.new('100') * Rational(1, 100)).to_i.should == 1 | ||
(BigDecimal.new('100') * Rational(49, 100)).to_i.should == 49 | ||
(BigDecimal.new('100') * Rational(50, 100)).to_i.should == 50 | ||
end | ||
end | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#GH-1938 | ||
require "test/unit" | ||
|
||
class TestIncludeOrder < Test::Unit::TestCase | ||
module X | ||
end | ||
|
||
class Q | ||
def foo arg = [] | ||
arg << :Q | ||
end | ||
end | ||
|
||
class Y < Q | ||
include X | ||
end | ||
|
||
module A | ||
def foo arg = [] | ||
arg << :A | ||
super | ||
end | ||
end | ||
|
||
module X | ||
include A | ||
end | ||
|
||
module Z | ||
def foo arg = [] | ||
arg << :Z | ||
super | ||
end | ||
end | ||
|
||
class Y | ||
include Z | ||
end | ||
|
||
class Y | ||
include X | ||
end | ||
|
||
def test_include_order | ||
assert_equal Y.new.foo, [:Z, :A, :Q] | ||
end | ||
end |