Skip to content

Commit 91c3273

Browse files
committed
Add GroovyAssertionsTests
Issue: #1710
1 parent bc417b4 commit 91c3273

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

junit-jupiter-engine/junit-jupiter-engine.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
groovy
3+
}
4+
15
apply(from = "$rootDir/gradle/testing.gradle.kts")
26

37
description = "JUnit Jupiter Engine"
@@ -31,6 +35,7 @@ dependencies {
3135
testImplementation(project(":junit-platform-runner"))
3236
testImplementation(project(":junit-platform-testkit"))
3337
testImplementation("org.jetbrains.kotlin:kotlin-stdlib")
38+
testImplementation(localGroovy())
3439
testImplementation("com.google.jimfs:jimfs:${Versions.jimfs}") {
3540
because("used to test TempDirectory extension")
3641
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package org.junit.jupiter.api
2+
3+
import groovy.transform.CompileStatic
4+
5+
import static org.junit.jupiter.api.Assertions.assertEquals
6+
import static org.junit.jupiter.api.Assertions.assertNotEquals
7+
8+
@CompileStatic
9+
class GroovyAssertionsTests {
10+
11+
@Test
12+
void "integers can be passed to assertEquals"() {
13+
assertEquals(42, 42)
14+
assertEquals(42, Integer.valueOf(42))
15+
assertEquals(Integer.valueOf(42), 42)
16+
// TODO add overload for assertEquals(Integer, Integer)
17+
//assertEquals(Integer.valueOf(42), Integer.valueOf(42))
18+
}
19+
20+
@Test
21+
void "integers can be passed to assertNotEquals"() {
22+
assertNotEquals(23, 42)
23+
assertNotEquals(23, Integer.valueOf(42))
24+
assertNotEquals(Integer.valueOf(23), 42)
25+
// TODO add overload for assertNotEquals(Integer, Integer)
26+
//assertNotEquals(Integer.valueOf(23), Integer.valueOf(42))
27+
}
28+
29+
}

0 commit comments

Comments
 (0)