Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of rectangle areas with stripes, while having test coverage enabled in Xcode?

Xcode 9.2. I have enabled test coverage, written some tests and run them.

On the right side of the editor, Xcode shows if a code has been tested or not by displaying red or green rectangles.

However, I don't know what is the meaning of a rectangle with stripes.

I have not managed to find an answer in Xcode guides or help files.

Screenshot:

code coverage - red rectangle with stripes

like image 505
Tomasz Nazarenko Avatar asked Dec 12 '17 10:12

Tomasz Nazarenko


1 Answers

The striped rectangles indicate partial code coverage. Somebody just asked this question elsewhere and in looking at some test cases, I realized that if you hover your mouse over a line with the stripes, you get something like this:

Partial code coverage

As you'll notice, part of the line is green and part of it is red. The green part is for the condition which comes under code coverage since that part was executed. The red part is for the error message which was not executed since the test passed. Hope that makes sense?

like image 82
Fahim Avatar answered Sep 27 '22 21:09

Fahim