On Wednesday, 9 May 2012 at 21:37:13 UTC, Era Scarecrow wrote:
An idea is coming to mind to change it all to a struct

You don't even need to convert it all to a struct. Since having function-nested unittests is just a parser issue, you can do this:

-----
int foo()
{
    static int bar()
    {
        return 42;
    }

    struct _
    {
        unittest {
            assert(bar() == 42);
        }
    }

    return bar();
}
-----

However 'bar' must be marked static in order for this to work.

Reply via email to