forked from ucsd-cse15l-f23/lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListTests.java
More file actions
40 lines (30 loc) · 890 Bytes
/
Copy pathListTests.java
File metadata and controls
40 lines (30 loc) · 890 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
38
39
40
import static org.junit.Assert.*;
import org.junit.*;
import java.util.ArrayList;
public class ListTests {
@Test
public void testMerge(){
ArrayList<String> input1 = new ArrayList<String>();
ArrayList<String> input2 = new ArrayList<String>();
input1.add("a");
input1.add("d");
input2.add("c");
input2.add("b");
ArrayList<String> output = new ArrayList<String>();
output.add("a");
output.add("b");
output.add("c");
output.add("d");
assertEquals(output, ListExamples.merge(input1, input2));
}
@Test
public void testFilter(){
ArrayList<String> input1 = new ArrayList<String>();
input1.add("a");
input1.add("d");
ListExamples.filter(input1, new MyChecker());
ArrayList<String> output = new ArrayList<String>();
output.add("a");
assertEquals(output, input1);
}
}