Skip to content

Commit 7e0a6b3

Browse files
add test for 78
1 parent 4c7aaa4 commit 7e0a6b3

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

src/main/java/com/fishercoder/solutions/_78.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class _78 {
2727

2828
public static class Solution1 {
29-
public static List<List<Integer>> subsets(int[] nums) {
29+
public List<List<Integer>> subsets(int[] nums) {
3030
List<List<Integer>> result = new ArrayList();
3131
if (nums == null) {
3232
return result;
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.common.utils.CommonUtils;
4+
import com.fishercoder.solutions._78;
5+
import org.junit.BeforeClass;
6+
import org.junit.Test;
7+
8+
public class _78Test {
9+
private static _78.Solution1 solution1;
10+
private static _78.Solution2 solution2;
11+
private static _78.Solution3 solution3;
12+
13+
@BeforeClass
14+
public static void setup() {
15+
solution1 = new _78.Solution1();
16+
solution2 = new _78.Solution2();
17+
solution3 = new _78.Solution3();
18+
}
19+
20+
@Test
21+
public void test1() {
22+
CommonUtils.printListList(solution1.subsets(new int[]{1, 2, 3}));
23+
}
24+
25+
@Test
26+
public void test2() {
27+
CommonUtils.printListList(solution2.subsets(new int[]{1, 2, 3}));
28+
}
29+
30+
@Test
31+
public void test3() {
32+
CommonUtils.printListList(solution3.subsets(new int[]{1, 2, 3}));
33+
}
34+
}

0 commit comments

Comments
 (0)