wasyl
10/20/2020, 3:52 PMwasyl
10/20/2020, 3:57 PMkotlin.time.Duration
, this test will pass:
class WorkingSpec : DescribeSpec() {
init {
describe("Inline class test") {
forAll(
row(1.minutes),
) { wrapped: Duration ->
println(wrapped)
}
}
}
}
while this one will fail:
class FailingSpec : DescribeSpec() {
init {
describe("Inline class test") {
forAll(
row(1.minutes, true),
) { wrapped: Duration, _ ->
println(wrapped)
}
}
}
}
wasyl
10/20/2020, 3:58 PMrow
with two parameters. And the failure is
java.lang.AssertionError: Test failed for (wrapped, 60.0s), (b, true) with error java.lang.ClassCastException: kotlin.time.Duration cannot be cast to java.lang.Number
sam
10/20/2020, 4:00 PMwasyl
10/20/2020, 4:04 PMwasyl
10/20/2020, 4:05 PMsam
10/20/2020, 4:05 PMsam
10/20/2020, 4:05 PMsam
10/20/2020, 4:05 PMwasyl
10/20/2020, 4:09 PMrow
functions?sam
10/20/2020, 4:09 PMsam
10/20/2020, 4:10 PMsam
10/20/2020, 4:10 PMwasyl
10/20/2020, 4:14 PMsam
10/20/2020, 4:14 PMsam
10/20/2020, 4:15 PMsam
10/20/2020, 4:15 PMwasyl
10/20/2020, 4:15 PMwasyl
10/20/2020, 4:15 PMsam
10/20/2020, 4:15 PMwasyl
10/21/2020, 1:37 PMit {}
(in Describe specs). This has an unintended consequence that we no longer can nest `describe`s inside, right?wasyl
10/21/2020, 1:38 PMit
inside it), but in fact no code was really executed for these tests. Seems like either allowing more complex tests inside forall, or crashing if unsupported nesting is found, would be nicesam
10/21/2020, 3:34 PMwasyl
10/21/2020, 3:38 PMwasyl
10/21/2020, 3:38 PMwasyl
10/21/2020, 3:40 PMforAll(row(sourceA, sourceB)) { source ->
describe("when we do X with $source") {
forAll(row(fooA, fooB)) { foo ->
describe("when we do Y with $foo") {
// more stuff with tests
}
}
}
}
sam
10/21/2020, 3:41 PMwasyl
10/21/2020, 3:48 PMsam
10/21/2020, 3:50 PM