Skip to content

Commit

Permalink
re-enable arrays-with-stdlib tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kindlich committed May 28, 2024
1 parent 04395eb commit 714ec7e
Showing 1 changed file with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,26 @@ public List<String> getRequiredStdLibModules() {
}

@Test
public void reverseWorks() {
public void reverseWorks_integers() {
ScriptBuilder.create()
.add("var array = [1, 2, 3, 4, 5];")
.add("println(array.isEmpty);")
.add("array.reverse();")
.add("for it in array println(it);")
.execute(this);

logger.assertPrintOutputSize(5);

for (int i = 5; i > 0; i--) {
logger.assertPrintOutput(5 - i, String.valueOf(i));
}
}

@Test
public void reverseWorks_strings() {
ScriptBuilder.create()
.add("var array = ['1', '2', '3', '4', '5'];")
.add("array.reverse();")
.add("for it in array println(it);")
.execute(this);

logger.assertPrintOutputSize(5);
Expand All @@ -37,7 +53,6 @@ public void reverseWorks() {


@Test
@Disabled("Requires stdlib")
public void canCastToList() {
ScriptBuilder.create()
.add("var array = ['a', 'b', 'c'] as string[];")
Expand All @@ -54,7 +69,6 @@ public void canCastToList() {
}

@Test
@Disabled("Requires stdlib")
public void canCastFromList() {
ScriptBuilder.create()
.add("var list = new stdlib.List<string>();")
Expand All @@ -74,7 +88,6 @@ public void canCastFromList() {
}

@Test
@Disabled("Requires stdlib")
public void sortedWithComparatorWorks() {
final int length = 10;

Expand Down Expand Up @@ -109,7 +122,6 @@ public void sortedWithComparatorWorks() {
}

@Test
@Disabled("Requires stdlib")
public void sortWithComparatorWorks() {
final int length = 10;

Expand Down

0 comments on commit 714ec7e

Please sign in to comment.