forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_468Test.java
85 lines (67 loc) · 1.87 KB
/
_468Test.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package com.fishercoder;
import com.fishercoder.solutions._468;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by stevesun on 6/10/17.
*/
public class _468Test {
private static _468 test;
@BeforeClass
public static void setup(){
test = new _468();
}
@Test
public void test1(){
assertEquals("IPv4", test.validIPAddress("172.16.254.1"));
}
@Test
public void test2(){
assertEquals("IPv6", test.validIPAddress("2001:0db8:85a3:0:0:8A2E:0370:7334"));
}
@Test
public void test3(){
assertEquals("Neither", test.validIPAddress("2001:0db8:85a3::8A2E:0370:7334"));
}
@Test
public void test4(){
assertEquals("Neither", test.validIPAddress("02001:0db8:85a3:0000:0000:8a2e:0370:7334"));
}
@Test
public void test5(){
assertEquals("Neither", test.validIPAddress("256.256.256.256"));
}
@Test
public void test6(){
assertEquals("Neither", test.validIPAddress("2001:0db8:85a3:0:0:8A2E:0370:7334:"));
}
@Test
public void test7(){
assertEquals("Neither", test.validIPAddress("01.01.01.01"));
}
@Test
public void test8(){
assertEquals("Neither", test.validIPAddress("00.0.0.0"));
}
@Test
public void test9(){
assertEquals("Neither", test.validIPAddress("000.0.0.0"));
}
@Test
public void test10(){
assertEquals("Neither", test.validIPAddress("0000.0.0.0"));
}
@Test
public void test11(){
assertEquals("IPv4", test.validIPAddress("0.0.0.0"));
}
@Test
public void test12(){
assertEquals("Neither", test.validIPAddress("1081:db8:85a3:01:-0:8A2E:0370:7334"));
}
@Test
public void test13(){
assertEquals("Neither", test.validIPAddress("1081:db8:85a3:01:z:8A2E:0370:7334"));
}
}