From 2e341d4605322ba53099bad818946dd8eefe2bb2 Mon Sep 17 00:00:00 2001 From: Ivan Kniazkov Date: Wed, 4 Sep 2024 13:09:29 +0300 Subject: [PATCH] More tests --- .../astranaut/core/algorithms/conversion/AdapterTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/cqfn/astranaut/core/algorithms/conversion/AdapterTest.java b/src/test/java/org/cqfn/astranaut/core/algorithms/conversion/AdapterTest.java index 21d2309..d07761f 100644 --- a/src/test/java/org/cqfn/astranaut/core/algorithms/conversion/AdapterTest.java +++ b/src/test/java/org/cqfn/astranaut/core/algorithms/conversion/AdapterTest.java @@ -323,7 +323,7 @@ void testPartialConversion() { ), DraftNode.create(AdapterTest.STR_INT_LITERAL, "1") ); - final int count = adapter.calculateConversions(original); + int count = adapter.calculateConversions(original); Assertions.assertEquals(2, count); final Node first = adapter.partialConvert(0, original); Assertions.assertEquals(AdapterTest.STR_ADDITION, first.getTypeName()); @@ -331,6 +331,11 @@ void testPartialConversion() { final Node second = adapter.partialConvert(1, original); Assertions.assertEquals(AdapterTest.STR_SUBTRACTION, second.getTypeName()); Assertions.assertEquals(AdapterTest.STR_ADDITION, second.getChild(0).getTypeName()); + final Node bad = DraftNode.create(AdapterTest.STR_INT_LITERAL, "0"); + count = adapter.calculateConversions(bad); + Assertions.assertEquals(0, count); + final Node third = adapter.partialConvert(0, bad); + Assertions.assertEquals(AdapterTest.STR_INT_LITERAL, third.getTypeName()); } /**