Skip to content

Commit e5ed6a4

Browse files
committed
update gradle
1 parent 3c371a1 commit e5ed6a4

3 files changed

Lines changed: 31 additions & 5 deletions

File tree

build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ tasks.withType(GenerateModuleMetadata) {
2828
}
2929

3030
dependencies {
31-
testImplementation('org.junit.jupiter:junit-jupiter:5.9.0')
31+
testImplementation platform('org.junit:junit-bom:5.9.0')
32+
testImplementation('org.junit.jupiter:junit-jupiter')
3233
}
3334

3435
jar {
@@ -41,9 +42,6 @@ jar {
4142

4243
test {
4344
useJUnitPlatform()
44-
testLogging {
45-
events('failed')
46-
}
4745
}
4846

4947
task javadocJar(type: Jar) {

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package io.parmigiano;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.junit.jupiter.api.Assertions.assertTrue;
6+
7+
// https://www.youtube.com/watch?v=s8-JXU8TeE8
8+
class TestPythagoras {
9+
10+
record Triple(int a, int b, int c) {
11+
boolean isPythagoras() {
12+
return a * a + b * b - c * c == 0;
13+
}
14+
}
15+
16+
Triple createTriple(int p, int q) {
17+
return new Triple(2 * p * q, p * p - q * q, p * p + q * q);
18+
}
19+
20+
@Test
21+
void checkTriples() {
22+
for (int p = 5; p < 10; p++) {
23+
for (int q = 15; q < 20; q++) {
24+
assertTrue(createTriple(p, q).isPythagoras());
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)