FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/src/test/java/com/sorts/PigeonholeSortTest.java at Development · iDev-git/Java · GitHub
iDev-git
Java
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
src
/
test
/
java
/
com
/
sorts
/
PigeonholeSortTest.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (21 loc) · 1004 Bytes
Breadcrumbs
Java
/
src
/
test
/
java
/
com
/
sorts
/
PigeonholeSortTest.java
Copy path
File metadata and controls
29 lines (21 loc) · 1004 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
com
.
sorts
;
import
org
.
junit
.
jupiter
.
api
.
Assertions
;
import
org
.
junit
.
jupiter
.
api
.
Test
;
class
PigeonholeSortTest
{
@
Test
void
testPigeonholeSort
() {
PigeonholeSort
pigeonholeSort
=
new
PigeonholeSort
();
// Test Case 1
Integer
[]
unsorted1
=
new
Integer
[]{
5
,
1
,
7
,
2
,
9
,
6
,
3
,
4
,
8
};
Integer
[]
sorted1
=
new
Integer
[]{
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
};
Assertions
.
assertArrayEquals
(
sorted1
,
pigeonholeSort
.
sort
(
unsorted1
));
// Test Case 2
Integer
[]
unsorted2
=
new
Integer
[]{-
5
,
1
,
7
,
2
, -
9
,
6
, -
3
,
4
,
8
};
Integer
[]
sorted2
=
new
Integer
[]{-
9
, -
5
, -
3
,
1
,
2
,
4
,
6
,
7
,
8
};
Assertions
.
assertArrayEquals
(
sorted2
,
pigeonholeSort
.
sort
(
unsorted2
));
// Test Case 3
Integer
[]
unsorted3
=
new
Integer
[]{-
5
,
1
,
7
,
2
, -
9
,
6
, -
3
,
4
,
1
,
8
,
1
,
1
};
Integer
[]
sorted3
=
new
Integer
[]{-
9
, -
5
, -
3
,
1
,
1
,
1
,
1
,
2
,
4
,
6
,
7
,
8
};
Assertions
.
assertArrayEquals
(
sorted3
,
pigeonholeSort
.
sort
(
unsorted3
));
}
}
Back
|
FazBrowse Home
|
New Git URL