Skip to content

Commit 24766ba

Browse files
committed
Test conversion from Array to array
1 parent fedea6b commit 24766ba

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

core/src/main/java/fj/data/Array.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import fj.function.Effect1;
1313

1414
import java.util.AbstractCollection;
15+
import java.util.ArrayList;
1516
import java.util.Collection;
1617
import java.util.Iterator;
1718
import java.util.NoSuchElementException;
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
package fj.data;
22

3+
import org.junit.Test;
4+
5+
import static org.hamcrest.CoreMatchers.equalTo;
6+
import static org.junit.Assert.assertThat;
7+
38
/**
49
* Created by MarkPerry on 14 Feb 16.
510
*/
611
public class ArrayTest {
712

8-
9-
public void test1() {
10-
13+
@Test
14+
public void toJavaArray() {
15+
final int max = 3;
16+
List<Integer> list = List.range(1, max + 1);
17+
assertThat(list.toArray().toJavaArray(), equalTo(list.toJavaArray()));
1118
}
1219

1320
}

0 commit comments

Comments
 (0)