Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kniazkov committed Sep 4, 2024
1 parent d089e7a commit 2e341d4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,19 @@ 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());
Assertions.assertEquals(AdapterTest.STR_SUBTRACTION, first.getChild(0).getTypeName());
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());
}

/**
Expand Down

0 comments on commit 2e341d4

Please sign in to comment.