[Issue 15590] New: the coverage fails in __ctfe branches

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jan 22 01:22:24 PST 2016


https://issues.dlang.org/show_bug.cgi?id=15590

          Issue ID: 15590
           Summary: the coverage fails in __ctfe branches
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

compile & run with -cov -unittest -main

       |auto foo()
       |{
      1|    if(__ctfe)
0000000|        return 1;
       |    else
      1|        return 0;
       |}
       |
       |unittest
       |{
       |    static assert(foo());
      1|    assert(!foo());
       |}
/home/basile/Bureau/temp/a.d is 75% covered

The process returns 0, meaning that the __ctfe branch has returned 1 and that
consequently the static assertion is correct, however coverage does not detect
it.

The problem is that because of this a module with __ctfe branches and static
assertions can't reach 100% coverage.

--


More information about the Digitalmars-d-bugs mailing list