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
|
import static org.junit.Assert.*;
import org.junit.Test;
public class AreSameTest {
@Test
public void test1() {
int[] a = new int[]{121, 144, 19, 161, 19, 144, 19, 11};
int[] b = new int[]{121, 14641, 20736, 361, 25921, 361, 20736, 361};
assertEquals(true, AreSame.comp(a, b));
}
@Test
public void test2() {
int[] a = new int[]{121, 144, 19, 161, 19, 144, 19, 11};
int[] b = new int[]{11 * 11, 121 * 121, 144 * 144, 190 * 190, 161 * 161, 19 * 19, 144 * 144, 19 * 19};
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test3() {
int[] a = new int[]{};
int[] b = new int[]{1};
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test4() {
int[] a = new int[]{};
int[] b = new int[]{};
assertEquals(true, AreSame.comp(a, b));
}
@Test
public void test5() {
int[] a = new int[]{};
int[] b = null;
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test6() {
int[] a = new int[]{121, 144, 19, 161, 19, 144, 19, 11, 1008};
int[] b = {11 * 11, 121 * 121, 144 * 144, 190 * 190, 161 * 161, 19 * 19, 144 * 144, 19 * 19};
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test7() {
int[] a = new int[]{121, 1440, 191, 161, 19, 144, 195, 11};
int[] b = {11 * 11, 121 * 121, 1440 * 1440, 191 * 191, 161 * 161, 19 * 19, 144 * 144, 195 * 195};
assertEquals(true, AreSame.comp(a, b));
}
@Test
public void test8() {
int[] a = new int[]{0, -14, 191, 161, 19, 144, 195, 1};
int[] b = {1, 0, 14 * 14, 191 * 191, 161 * 161, 19 * 19, 144 * 144, 195 * 195};
assertEquals(true, AreSame.comp(a, b));
}
@Test
public void test9() {
int[] a = new int[]{0, -14, 191, 161, 19, 144, 195, 1, 2};
int[] b = {1, 0, 14 * 14, 191 * 191, 161 * 161, 19 * 19, 144 * 144, 195 * 195, 3};
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test10() {
int[] a = new int[]{2, 2, 3};
int[] b = {4, 9, 9};
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test1a() {
int[] a = new int[]{2, 2, 3};
int[] b = {4, 4, 9};
assertEquals(true, AreSame.comp(a, b));
}
@Test
public void test2a() {
int[] a = new int[]{4, 4};
int[] b = {1, 31};
assertEquals(false, AreSame.comp(a, b));
}
@Test
public void test3a() {
int[] a = new int[]{3, 4};
int[] b = {0, 25};
assertEquals(false, AreSame.comp(a, b));
}
}
|