File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
core/src/test/java/fj/data Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ package fj .data ;
2
+
3
+ import org .junit .Test ;
4
+
5
+ import static fj .data .DList .*;
6
+ import static org .hamcrest .core .Is .is ;
7
+ import static org .junit .Assert .assertThat ;
8
+
9
+ public class DListTest {
10
+ @ Test
11
+ public void testConsSnoc () {
12
+ assertThat (nil ().snoc (2 ).cons (1 ).toJavaList (), is (single (1 ).snoc (2 ).toJavaList ()));
13
+ }
14
+
15
+ @ Test
16
+ public void testListDList () {
17
+ DList <Integer > d = listDList (List .range (0 , 1000 ));
18
+ assertThat (d .toJavaList (), is (List .range (0 , 1000 ).toJavaList ()));
19
+ }
20
+
21
+ @ Test
22
+ public void testArrayDList () {
23
+ DList <Integer > d = arrayDList (Array .range (0 , 1000 ).array (Integer [].class ));
24
+ assertThat (d .toJavaList (), is (Array .range (0 , 1000 ).toJavaList ()));
25
+ }
26
+ @ Test
27
+ public void testIter () {
28
+ DList <Integer > d = iteratorDList (List .range (0 , 1000 ).iterator ());
29
+ assertThat (d .toJavaList (), is (List .range (0 , 1000 ).toJavaList ()));
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments