Add more specific fail messages in inline class box tests

This commit is contained in:
Svyatoslav Kuzmich
2018-10-31 15:17:27 +03:00
parent 370b04df35
commit 43b4b6eaae
3 changed files with 15 additions and 16 deletions
@@ -33,12 +33,11 @@ fun box(): String {
val a = inlinedId(f).idExtension() // box unbox
val b = inlinedId(f).inlinedIdExtension() // box unbox
if (a.value != 11) return "fail"
if (b.value != 11) return "fail"
if (a.value != 11) return "fail 1"
if (b.value != 11) return "fail 2"
if (inlinedId(Foo(10)).value != 10) return "fail"
if (Foo(20).inlinedIdExtension().value != 20) return "fail"
if (inlinedId(Foo(10)).value != 10) return "fail 3"
if (Foo(20).inlinedIdExtension().value != 20) return "fail 4"
return "OK"
}
}
@@ -23,8 +23,8 @@ fun test(f: Foo): String {
val a = id(f) // box unbox
val b = id(f).idExtension() // box unbox
if (a.asResult() != 10) return "fail"
if (b.asResult() != 10) return "fail"
if (a.asResult() != 10) return "fail a"
if (b.asResult() != 10) return "fail b"
return "OK"
}
@@ -33,4 +33,4 @@ fun box(): String {
val f = Foo(10)
return test(f)
}
}
@@ -29,13 +29,13 @@ fun box(): String {
val unboxedResult = asResult.typed()
val unboxedAsCtor = asResultCtor.typed()
if (unboxedInt != 19) return "fail"
if (unboxedString != "sample") return "fail"
if (unboxedResult.typed() != 19) return "fail"
if (unboxedAsCtor.typed() != 10) return "fail"
if (unboxedInt != 19) return "fail 1"
if (unboxedString != "sample") return "fail 2"
if (unboxedResult.typed() != 19) return "fail 3"
if (unboxedAsCtor.typed() != 10) return "fail 4"
if (asResult.typed().typed() != 19) return "fail"
if (asResultCtor.typed().typed() != 10) return "fail"
if (asResult.typed().typed() != 19) return "fail 5"
if (asResultCtor.typed().typed() != 10) return "fail 6"
return "OK"
}
}