You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for this great library! I would like to ask about adding support for a new feature.
I want to create a test case where I pass an input String along with an expected output data type that the subject in test will parse the string into another data type, in this situation, a FloatArray.
I noticed that the TestParameterInjector supports this feature through a set of parameters. Is there a way to achieve the same functionality with Burst?
I have tried several approaches to accomplish this, and while they work, they feel a bit off. Here's what I have attempted:
Using a Pair<String, FloatArray>
Using a data class to wrap the values
Using a simple class
All three methods work, but the generated test names are quite unhelpful. For instance, the following test case:
@Burst
classSvgViewBoxTest {
@Test
funtestViewBoxWithSpacesAsSeparators(
params:Pair<String, FloatArray> = burstValues(
"0 0 120 120" to floatArrayOf(0f, 0f, 120f, 120f),
"10 0 3000 120" to floatArrayOf(10f, 0f, 3000f, 120f),
"0 0 0 1200" to floatArrayOf(0f, 0f, 0f, 1200f),
"10 150 500 20" to floatArrayOf(10f, 150f, 500f, 20f),
),
) {
val (viewBox, expected) = params
println("viewBox = $viewBox, expected = ${expected.toList()}")
val svgNode =SvgRootNode(
parent =XmlRootNode(children =mutableSetOf()),
children =mutableSetOf(),
attributes =mutableMapOf(
"viewBox" to viewBox,
),
)
val actual = svgNode.parseViewBox()
assertContentEquals(expected, actual)
}
}
For the "set of parameter" option, it would be helpful if the output were formatted like this: testViewBoxWithSpacesAsSeparators_0_0_120_120_to_0f_0f_120f_120f.
Alternatively, another format could be: testViewBoxWithSpacesAsSeparators_[0_0_120_120]_to_[0f 0f 120f 120f], however, I believe the last option may not be feasible because using [ and ] as characters are not allowed in test names.
I would appreciate any guidance on how to make the test name outputs more informative when using Burst.
Thank you!
The text was updated successfully, but these errors were encountered:
Thank you for this great library! I would like to ask about adding support for a new feature.
I want to create a test case where I pass an input
String
along with an expected output data type that the subject in test will parse the string into another data type, in this situation, aFloatArray
.I noticed that the TestParameterInjector supports this feature through a set of parameters. Is there a way to achieve the same functionality with Burst?
I have tried several approaches to accomplish this, and while they work, they feel a bit off. Here's what I have attempted:
Pair<String, FloatArray>
data class
to wrap the valuesclass
All three methods work, but the generated test names are quite unhelpful. For instance, the following test case:
Outputs the following test names:
testViewBoxWithSpacesAsSeparators
testViewBoxWithSpacesAsSeparators_1_to
testViewBoxWithSpacesAsSeparators_2_to
testViewBoxWithSpacesAsSeparators_3_to
In contrast, another test case:
yields more descriptive output:
testSumIsEven
testSumIsEven_2_4
testSumIsEven_2_6
testSumIsEven_4_2
testSumIsEven_4_4
testSumIsEven_4_6
testSumIsEven_6_2
testSumIsEven_6_4
testSumIsEven_6_6
For the "set of parameter" option, it would be helpful if the output were formatted like this:
testViewBoxWithSpacesAsSeparators_0_0_120_120_to_0f_0f_120f_120f
.Alternatively, another format could be:
testViewBoxWithSpacesAsSeparators_[0_0_120_120]_to_[0f 0f 120f 120f]
, however, I believe the last option may not be feasible because using[
and]
as characters are not allowed in test names.I would appreciate any guidance on how to make the test name outputs more informative when using Burst.
Thank you!
The text was updated successfully, but these errors were encountered: