diff --git a/examples/chip-tool/templates/tests/partials/value_equals.zapt b/examples/chip-tool/templates/tests/partials/value_equals.zapt index e387036b293662..8e9b9d021c884b 100644 --- a/examples/chip-tool/templates/tests/partials/value_equals.zapt +++ b/examples/chip-tool/templates/tests/partials/value_equals.zapt @@ -6,6 +6,7 @@ VerifyOrReturn(CheckValueNull("{{label}}", {{actual}})); {{else}} {{#if (chip_tests_variables_has expected)}} + {{#if (chip_tests_variables_is_nullable expected)}} {{! Expected value is also a nullable. }} if ({{expected}}.IsNull()) { VerifyOrReturn(CheckValueNull("{{label}}", {{actual}})); @@ -15,6 +16,10 @@ VerifyOrReturn(CheckValueNonNull("{{label}}", {{actual}})); {{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=(concat expected ".Value()") isNullable=false keepAsExpected=true depth=(incrementDepth depth)}} } + {{else}} + VerifyOrReturn(CheckValueNonNull("{{label}}", {{actual}})); + {{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isNullable=false keepAsExpected=true depth=(incrementDepth depth)}} + {{/if}} {{else}} VerifyOrReturn(CheckValueNonNull("{{label}}", {{actual}})); {{>valueEquals label=(concat label ".Value()") actual=(concat actual ".Value()") expected=expected isNullable=false depth=(incrementDepth depth)}}