Add sumtype to Phobos (#7702)

Add sumtype to Phobos
merged-on-behalf-of: unknown
This commit is contained in:
Paul Backus 2021-03-05 06:41:34 -05:00 committed by GitHub
parent cb3f5e29ab
commit 51a70ee267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 2558 additions and 7 deletions

View file

@ -0,0 +1,30 @@
static immutable bettercModules = [
"std.sumtype"
];
template from(string modname)
{
mixin("import from = ", modname, ";");
}
void testModule(string modname)()
{
import core.stdc.stdio : printf;
printf("Running BetterC tests for %.*s\n", cast(int) modname.length, modname.ptr);
static foreach (test; __traits(getUnitTests, from!modname))
{
test();
}
}
extern(C) int main()
{
static foreach (modname; bettercModules)
{
testModule!modname;
}
return 0;
}