Skip to content

Commit 711192c

Browse files
committed
Move tests under org.truffleruby.test package
1 parent c3400a8 commit 711192c

16 files changed

+24
-18
lines changed

mx.truffleruby/mx_truffleruby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def ruby_check_heap_dump(input_args, out=None):
150150
vm_args, truffleruby_args = mx.extract_VM_args(args, useDoubleDash=True, defaultAllVMArgs=False)
151151
vm_args += mx.get_runtime_jvm_args(dists)
152152
# vm_args.append("-agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=y")
153-
vm_args.append("org.truffleruby.LeakTest")
153+
vm_args.append("org.truffleruby.test.LeakTest")
154154
out = mx.OutputCapture() if out is None else out
155155
retval = mx.run_java(vm_args + truffleruby_args, jdk=jdk, nonZeroIsFatal=False, out=out)
156156
if retval == 0:

src/main/java/org/truffleruby/language/loader/EmbeddedScript.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ private boolean isShebangLine(byte[] bytes, int lineStart) {
103103
return bytes.length - lineStart >= 2 && bytes[lineStart] == '#' && bytes[lineStart + 1] == '!';
104104
}
105105

106-
static boolean lineContainsRuby(byte[] bytes, int lineStart, int lineLength) {
106+
public static boolean lineContainsRuby(byte[] bytes, int lineStart, int lineLength) {
107107
if (lineLength < 4) {
108108
return false;
109109
}

src/test/java/org/truffleruby/ArrayBuilderTest.java renamed to src/test/java/org/truffleruby/test/ArrayBuilderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import static org.junit.Assert.assertEquals;
1313

@@ -24,6 +24,7 @@
2424
import org.junit.After;
2525
import org.junit.Before;
2626
import org.junit.Test;
27+
import org.truffleruby.RubyLanguage;
2728
import org.truffleruby.core.array.ArrayBuilderNode;
2829
import org.truffleruby.core.array.RubyArray;
2930
import org.truffleruby.core.array.ArrayBuilderNode.BuilderState;

src/test/java/org/truffleruby/ArrayStoreTest.java renamed to src/test/java/org/truffleruby/test/ArrayStoreTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import static org.junit.Assert.assertEquals;
1313
import static org.junit.Assert.assertFalse;
1414
import static org.junit.Assert.assertTrue;
15-
import static org.truffleruby.RubyTest.assertThrows;
15+
import static org.truffleruby.test.RubyTest.assertThrows;
1616

1717
import org.junit.Test;
1818
import org.truffleruby.core.array.library.ArrayStoreLibrary;

src/test/java/org/truffleruby/ContextPermissionsTest.java renamed to src/test/java/org/truffleruby/test/ContextPermissionsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import org.graalvm.polyglot.Context;
1313
import org.graalvm.polyglot.Value;

src/test/java/org/truffleruby/language/loader/EmbeddedScriptTest.java renamed to src/test/java/org/truffleruby/test/EmbeddedScriptTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,22 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby.language.loader;
10+
package org.truffleruby.test;
1111

1212
import static junit.framework.TestCase.assertFalse;
1313
import static junit.framework.TestCase.assertTrue;
1414

15+
import junit.framework.TestCase;
1516
import org.junit.Test;
1617
import org.truffleruby.core.string.StringOperations;
18+
import org.truffleruby.language.loader.EmbeddedScript;
1719

1820
public class EmbeddedScriptTest {
1921

2022
@Test
2123
public void testLineContainsRubyFalse() {
2224
final byte[] bytes = bytes("foo bar baz");
23-
assertFalse(EmbeddedScript.lineContainsRuby(bytes, 0, bytes.length));
25+
TestCase.assertFalse(EmbeddedScript.lineContainsRuby(bytes, 0, bytes.length));
2426
}
2527

2628
@Test

src/test/java/org/truffleruby/JSR223InteropTest.java renamed to src/test/java/org/truffleruby/test/JSR223InteropTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import static org.junit.Assert.assertEquals;
1313
import static org.junit.Assert.assertTrue;

src/test/java/org/truffleruby/LeakTest.java renamed to src/test/java/org/truffleruby/test/LeakTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import java.io.IOException;
1313
import java.lang.management.ManagementFactory;

src/test/java/org/truffleruby/MiscTest.java renamed to src/test/java/org/truffleruby/test/MiscTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import static org.junit.Assert.assertEquals;
1313
import static org.junit.Assert.assertFalse;

src/test/java/org/truffleruby/PolyglotIOTest.java renamed to src/test/java/org/truffleruby/test/PolyglotIOTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* GNU General Public License version 2, or
88
* GNU Lesser General Public License version 2.1.
99
*/
10-
package org.truffleruby;
10+
package org.truffleruby.test;
1111

1212
import static org.junit.Assert.assertEquals;
1313

0 commit comments

Comments
 (0)