DlangT

\struct DlangT D-source generator

@safe
struct DlangT (
Stream
) {
Stream bout;
static
string[] preparations;
}

Examples

Examples: Converting a FeatureGroup to a D-source skeleten

auto bout = new OutBuffer;
auto dlang = Dlang(bout);
alias unit_mangle = mangleFunc!(DlangU);
const feature_group = getFeature!(tagion.behaviour.BehaviourUnittest);
{
    scope (exit) {
        bout.clear;
    }
    enum filename = unit_mangle("feature")
            .setExtension(FileExtension.dsrc);
    dlang.issue(feature_group);
    immutable result = bout.toString;
    version (behaviour_unitdata)
        filename.unitfile.setExtension("dtest").fwrite(result.trim_source.join("\n"));
    enum expected = import(filename);
    assert(equal(
            result
            .trim_source,
            expected
            .trim_source
    ));
}