diff --git a/test/98_unittest.pm b/test/98_unittest.pm index 5fcd69308..e1e1c8d97 100644 --- a/test/98_unittest.pm +++ b/test/98_unittest.pm @@ -157,8 +157,12 @@ sub UnitTest_Test_generic readingsSingleUpdate($hash, "state", "running", 1); my $ret =""; $ret =eval $hash->{'.testcode'} if ($hash->{'.testcode'}); - if ($@) { - Log3 $name, 5, "return from eval was ".$ret." with error $@" if $ret; + unless ($ret) { + Log3 $name, 5, "return from eval was with error $@" ; + } + if ($ret) + { + Log3 $name, 5, "Test has following result: $ret" ; } # enable warnings for prototype mismatch