- Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a bugpriority-top-focusTop priority chosen by dev teamTop priority chosen by dev team
Description
Description
assert statement in test generated for execution throwing explicit exception is missed
To Reproduce
Run tests generation for factorial
function from Samples.
Expected behavior
Test code finishes with assertThrows
statement.
Code is dependent on the used test framework, for JUnit5 it is something like
assertThrows(IllegalArgumentException, () -> factorial(-1))
Actual behavior
@Test @DisplayName("factorial: n < 0 -> ThrowIllegalArgumentException") public void testFactorial_NLessThanZero() throws Throwable { Fact fact = new Fact(); /* This test fails because executable under testing Fact.factorial produces Runtime exception java.lang.IllegalArgumentException */ fact.factorial(-1); }
Metadata
Metadata
Assignees
Labels
comp-codegenIssue is related to code generatorIssue is related to code generatorctg-bugIssue is a bugIssue is a bugpriority-top-focusTop priority chosen by dev teamTop priority chosen by dev team
Type
Projects
Status
Done