forked from haoel/leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrStrTest.java
More file actions
24 lines (20 loc) · 604 Bytes
/
strStrTest.java
File metadata and controls
24 lines (20 loc) · 604 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
package strStr;
import com.sun.org.apache.xpath.internal.operations.Equals;
import static org.junit.Assert.*;
/**
* Created by leicao on 2/10/15.
*/
public class strStrTest {
@org.junit.Test
public void testStrStr() throws Exception {
strStr strStr = new strStr();
String[][] inputs = {
{"I am the haystack!","haystack!"},
{"I am the haystack!","haytack"},
};
int[] outputs = {9, -1};
for (int i = 0; i < inputs.length; i++) {
assertEquals(outputs[i], strStr.strStr(inputs[i][0], inputs[i][1]));
}
}
}