Skip to content

Commit 9642e02

Browse files
committed
Added tests
1 parent c0c6d0a commit 9642e02

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ dependencies {
1818
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:[1.11.3,)'
1919
}
2020

21-
test {
22-
useJUnitPlatform()
21+
testing {
22+
suites {
23+
test {
24+
useJUnitJupiter()
25+
}
26+
}
27+
}
28+
29+
tasks.withType(Test).configureEach {
2330
maxParallelForks = Runtime.runtime.availableProcessors()
2431
}
2532

src/test/java/g3301_3400/s3354_make_array_elements_equal_to_zero/SolutionTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@ void countValidSelections2() {
1616
assertThat(
1717
new Solution().countValidSelections(new int[] {2, 3, 4, 0, 4, 1, 0}), equalTo(0));
1818
}
19+
20+
@Test
21+
void countValidSelections3() {
22+
assertThat(
23+
new Solution()
24+
.countValidSelections(new int[] {16, 13, 10, 0, 0, 0, 10, 6, 7, 8, 7}),
25+
equalTo(3));
26+
}
1927
}

src/test/java/g3301_3400/s3355_zero_array_transformation_i/SolutionTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@ void isZeroArray2() {
1919
new Solution().isZeroArray(new int[] {4, 3, 2, 1}, new int[][] {{1, 3}, {0, 2}}),
2020
equalTo(false));
2121
}
22+
23+
@Test
24+
void isZeroArray3() {
25+
assertThat(
26+
new Solution().isZeroArray(new int[] {-1, 0, 1}, new int[][] {{1, 3}, {0, 2}}),
27+
equalTo(true));
28+
}
2229
}

src/test/java/g3301_3400/s3357_minimize_the_maximum_adjacent_element_difference/SolutionTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,9 @@ void minDifference2() {
2020
void minDifference3() {
2121
assertThat(new Solution().minDifference(new int[] {-1, 10, -1, 8}), equalTo(1));
2222
}
23+
24+
@Test
25+
void minDifference4() {
26+
assertThat(new Solution().minDifference(new int[] {14, -1, -1, 46}), equalTo(11));
27+
}
2328
}

0 commit comments

Comments
 (0)