[Issue 15580] New: Coverage Reports Should Not Count Lines in Unit Test Blocks
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Mon Jan 18 08:46:12 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15580
          Issue ID: 15580
           Summary: Coverage Reports Should Not Count Lines in Unit Test
                    Blocks
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com
Consider the following code
unittest
{
    struct G
    {
        int opCall (int i) { return 1;}
    }
    alias ShouldBeInt = ReturnType!G;
    static assert(is(ShouldBeInt == int));
}
This is from a unit test block in std.traits. The coverage report gives
       |unittest
       |{
      1|    struct G
       |    {
0000000|        int opCall (int i) { return 1;}
       |    }
       |
      1|    alias ShouldBeInt = ReturnType!G;
       |    static assert(is(ShouldBeInt == int));
       |}
This is misleading, the line is technically never called during run time, but
it is used.
--
    
    
More information about the Digitalmars-d-bugs
mailing list