forked from functionaljava/functionaljava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeqTest.java
More file actions
37 lines (31 loc) · 942 Bytes
/
SeqTest.java
File metadata and controls
37 lines (31 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package fj.data;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Created by MarkPerry on 16/01/2015.
*/
public class SeqTest {
@Test
public void objectMethods() {
Seq<Integer> s1 = Seq.seq(1, 2, 3);
Seq<Integer> s2 = Seq.seq(1, 2, 3);
assertTrue(s1.toString().equals("Seq(1,2,3)"));
assertTrue(s1.equals(s2));
assertFalse(s1 == s2);
}
@Test
public void convertToString() {
final int n = 10000;
final StringBuilder expected = new StringBuilder("Seq(");
for (int i = 0; i < n; i++) {
expected.append(i);
if (i < n - 1) {
expected.append(',');
}
}
expected.append(')');
assertEquals(expected.toString(), Seq.seq(Array.range(0, 10000).array()).toString());
}
}