From 6441d6530cb392c50e5f035db2418697abe00fe7 Mon Sep 17 00:00:00 2001 From: Szabo Bogdan Date: Mon, 2 May 2022 19:17:30 +0200 Subject: [PATCH] fix handling values failing after an assert started --- source/fluentasserts/core/evaluation.d | 1 - source/fluentasserts/core/operations/registry.d | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/fluentasserts/core/evaluation.d b/source/fluentasserts/core/evaluation.d index c504665..7829aa8 100644 --- a/source/fluentasserts/core/evaluation.d +++ b/source/fluentasserts/core/evaluation.d @@ -334,7 +334,6 @@ class ArrayEquable(U: T[], T) : EquableValue { } @trusted EquableValue[] toArray() { - try { "array.toArray".writeln; } catch(Exception) {} static if(is(T == void)) { return []; } else { diff --git a/source/fluentasserts/core/operations/registry.d b/source/fluentasserts/core/operations/registry.d index 7fadbc4..2a9968c 100644 --- a/source/fluentasserts/core/operations/registry.d +++ b/source/fluentasserts/core/operations/registry.d @@ -74,6 +74,10 @@ class Registry { /// IResult[] handle(ref Evaluation evaluation) @safe nothrow { + if(evaluation.operationName == "" || evaluation.operationName == "to" || evaluation.operationName == "should") { + return []; + } + auto operation = this.get( evaluation.currentValue.typeName, evaluation.expectedValue.typeName,