From 1817be4b713648a73bf39aad2f1f4db07bd3b8a6 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Thu, 15 Sep 2022 12:38:01 +0300 Subject: [PATCH] added extra test for xor --- .../ExpressionSimplificationExpected.kt | 7 +++++++ .../boolean_expressions/ExpressionSimplificationTest.kt | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationExpected.kt b/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationExpected.kt index 814f2fd023..5530dfea07 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationExpected.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationExpected.kt @@ -13,3 +13,10 @@ fun F.foo2() { return false } } + +fun F.foo3() { + if (!(this.valueParameters[i].getFunctionName() xor other.valueParameters[i].getFunctionName()) || !(this.valueParameters[i].getFunctionType() xor other.valueParameters[i].getFunctionType()) + ) { + return false + } +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationTest.kt b/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationTest.kt index 5daead3134..2e6c225278 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/boolean_expressions/ExpressionSimplificationTest.kt @@ -15,3 +15,11 @@ fun F.foo2() { return false } } + +fun F.foo3() { + if (!(this.valueParameters[i].getFunctionName() xor other.valueParameters[i].getFunctionName() && + this.valueParameters[i].getFunctionType() xor other.valueParameters[i].getFunctionType()) + ) { + return false + } +}