Skip to content

Missed assert statement in test generated for execution with explicit exception #79

@EgorkaKulikov

Description

@EgorkaKulikov

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 generatorctg-bugIssue is a bugpriority-top-focusTop priority chosen by dev team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions