Skip to content

Commit 30126c5

Browse files
sormurasmarcphilipp
authored andcommitted
Add Kotlin-based display name test
Issue #1836
1 parent 49ac10c commit 30126c5

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2015-2019 the original author or authors.
3+
*
4+
* All rights reserved. This program and the accompanying materials are
5+
* made available under the terms of the Eclipse Public License v2.0 which
6+
* accompanies this distribution and is available at
7+
*
8+
* http://www.eclipse.org/legal/epl-v20.html
9+
*/
10+
@file:Suppress("unused")
11+
12+
package org.junit.jupiter.params.aggregator
13+
14+
import org.junit.jupiter.api.Assertions.assertEquals
15+
import org.junit.jupiter.api.TestInfo
16+
import org.junit.jupiter.params.ParameterizedTest
17+
import org.junit.jupiter.params.provider.MethodSource
18+
19+
// https://github.com/junit-team/junit5/issues/1836
20+
object DisplayNameTests {
21+
@JvmStatic
22+
fun data() = arrayOf(
23+
arrayOf("A", 1),
24+
arrayOf("B", 2),
25+
arrayOf("C", 3)
26+
)
27+
28+
@ParameterizedTest
29+
@MethodSource("data")
30+
fun test(char: String, number: Int, info: TestInfo) {
31+
assertEquals("[$number] $char, $number", info.displayName)
32+
}
33+
}

0 commit comments

Comments
 (0)