forked from ucsd-cse15l-f23/lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListTests.java
43 lines (36 loc) · 1 KB
/
ListTests.java
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
41
import static org.junit.Assert.*;
import org.junit.*;
import java.util.ArrayList;
import java.util.List;
public class ListTests {
@Test
public void testFilter(){
StringChecker a = new checkString1();
List<String> x = new ArrayList<String>();
x.add("Fire");
x.add("water111");
x.add("ye");
ArrayList<String> ans = new ArrayList<>();
ans.add("Fire");
ans.add("ye");
List<String> ans1 = ListExamples.filter(x, a);
assertEquals(ans, ans1 );
}
@Test
public void testMerge(){
List<String> x = new ArrayList<String>(), y = new ArrayList<String>() ;
y.add("a");
y.add("d");
y.add("z");
x.add("b");
x.add("c");
List<String> ans1 = ListExamples.merge(x, y);
ArrayList<String> ans = new ArrayList<>();
ans.add("a");
ans.add("b");
ans.add("c");
ans.add("d");
ans.add("z");
assertEquals(ans, ans1);
}
}