Neo: Avoid conditions with one line

Created on 12 Sep 2019  路  3Comments  路  Source: neo-project/neo

Summary
The current coverage engine think that the whole line is covered although the condition was not met, so maybe we have a wrong coverage percentage because some parts of the code are not tested.

For example

if (a==1) return -1;
return a;

In this case, if you test this method with the value a=2 full method will be covered, and is not. We should have test for a==1 too.

Do you have any solution you want to propose?
Avoid one line for conditions or change the coverage engine.

Where in software does this update applies to?

  • Other: All modules
discussion house-keeping

Most helpful comment

This will be closed when we migrate all projects to coveralls.io like neo-vm with https://github.com/neo-project/neo-vm/pull/228 .

As you can see, the 'coveralls.io` distinguish a single line https://coveralls.io/builds/27171399/source?filename=src/neo-vm/ExecutionEngine.cs#L351

All 3 comments

Maybe we need to define a writing rule to avoid the one line if conditional statement.

This will be closed when we migrate all projects to coveralls.io like neo-vm with https://github.com/neo-project/neo-vm/pull/228 .

As you can see, the 'coveralls.io` distinguish a single line https://coveralls.io/builds/27171399/source?filename=src/neo-vm/ExecutionEngine.cs#L351

Closing as requested by Shargon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

garrey332 picture garrey332  路  3Comments

vncoelho picture vncoelho  路  3Comments

borovik96 picture borovik96  路  4Comments

shargon picture shargon  路  3Comments

roman-khimov picture roman-khimov  路  3Comments