From 4b77db89795c6034d955b52d9066a010a770dd21 Mon Sep 17 00:00:00 2001 From: Mads Ager Date: Mon, 21 Oct 2019 13:30:07 +0200 Subject: [PATCH] Fix test to actually fail if expected exception is not thrown. --- .../codegen/box/defaultArguments/useNextParamInLambda.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt b/compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt index ee46fb45d3a..1fc4c02166d 100644 --- a/compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt +++ b/compiler/testData/codegen/box/defaultArguments/useNextParamInLambda.kt @@ -2,15 +2,14 @@ fun f( f1: () -> String = { f2() }, - f2: () -> String = { "FAIL" } + f2: () -> String = { "Fail: should not be called" } ): String = f1() fun box(): String { - var result = "fail" try { f() + return "Fail: f() should have thrown NPE" } catch (e : Exception) { - result = "OK" } return f(f2 = { "O" }) + f(f1 = { "K" }) }