|
7 | 7 | import static org.junit.Assert.assertEquals;
|
8 | 8 |
|
9 | 9 | public class _953Test {
|
10 |
| - private static _953.Solution1 solution1; |
11 |
| - private static String[] words; |
12 |
| - private static String order; |
| 10 | + private static _953.Solution1 solution1; |
| 11 | + private static _953.Solution2 solution2; |
| 12 | + private static String[] words; |
| 13 | + private static String order; |
13 | 14 |
|
14 |
| - @BeforeClass |
15 |
| - public static void setup() { |
16 |
| - solution1 = new _953.Solution1(); |
17 |
| - } |
| 15 | + @BeforeClass |
| 16 | + public static void setup() { |
| 17 | + solution1 = new _953.Solution1(); |
| 18 | + solution2 = new _953.Solution2(); |
| 19 | + } |
18 | 20 |
|
19 |
| - @Test |
20 |
| - public void test1() { |
21 |
| - words = new String[] {"hello", "leetcode"}; |
22 |
| - order = "hlabcdefgijkmnopqrstuvwxyz"; |
23 |
| - assertEquals(true, solution1.isAlienSorted(words, order)); |
24 |
| - } |
| 21 | + @Test |
| 22 | + public void test1() { |
| 23 | + words = new String[]{"hello", "leetcode"}; |
| 24 | + order = "hlabcdefgijkmnopqrstuvwxyz"; |
| 25 | + assertEquals(true, solution1.isAlienSorted(words, order)); |
| 26 | + assertEquals(true, solution2.isAlienSorted(words, order)); |
| 27 | + } |
25 | 28 |
|
26 |
| - @Test |
27 |
| - public void test2() { |
28 |
| - words = new String[] {"word", "world", "row"}; |
29 |
| - order = "worldabcefghijkmnpqstuvxyz"; |
30 |
| - assertEquals(false, solution1.isAlienSorted(words, order)); |
31 |
| - } |
| 29 | + @Test |
| 30 | + public void test2() { |
| 31 | + words = new String[]{"word", "world", "row"}; |
| 32 | + order = "worldabcefghijkmnpqstuvxyz"; |
| 33 | + assertEquals(false, solution1.isAlienSorted(words, order)); |
| 34 | + assertEquals(false, solution2.isAlienSorted(words, order)); |
| 35 | + } |
32 | 36 |
|
33 |
| - @Test |
34 |
| - public void test3() { |
35 |
| - words = new String[] {"apple", "app"}; |
36 |
| - order = "abcdefghijklmnopqrstuvwxyz"; |
37 |
| - assertEquals(false, solution1.isAlienSorted(words, order)); |
38 |
| - } |
| 37 | + @Test |
| 38 | + public void test3() { |
| 39 | + words = new String[]{"apple", "app"}; |
| 40 | + order = "abcdefghijklmnopqrstuvwxyz"; |
| 41 | + assertEquals(false, solution1.isAlienSorted(words, order)); |
| 42 | + assertEquals(false, solution2.isAlienSorted(words, order)); |
| 43 | + } |
39 | 44 | }
|
0 commit comments