Newer
Older
dub_jkp / test / unittest-cov-ctfe / source / mod.d
@Per Nordlöw Per Nordlöw on 7 Jun 2022 180 bytes Add support for coverage at compile-time (CTFE)
module mod;

int f(int x)
{
	return x + 1;
}

int g(int x)
{
	return x * 2;
}

enum gResult = g(12);			// execute g() at compile-time

unittest
{
	assert(f(11) + gResult == 36);
}