Skip to content

Commit

Permalink
Add Kotlin-based display name test
Browse files Browse the repository at this point in the history
Issue #1836
  • Loading branch information
sormuras authored and marcphilipp committed Apr 7, 2019
1 parent 49ac10c commit 30126c5
Showing 1 changed file with 33 additions and 0 deletions.
@@ -0,0 +1,33 @@
/*
* Copyright 2015-2019 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v2.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v20.html
*/
@file:Suppress("unused")

package org.junit.jupiter.params.aggregator

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.TestInfo
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource

// https://github.com/junit-team/junit5/issues/1836
object DisplayNameTests {
@JvmStatic
fun data() = arrayOf(
arrayOf("A", 1),
arrayOf("B", 2),
arrayOf("C", 3)
)

@ParameterizedTest
@MethodSource("data")
fun test(char: String, number: Int, info: TestInfo) {
assertEquals("[$number] $char, $number", info.displayName)
}
}

0 comments on commit 30126c5

Please sign in to comment.