Skip to content

Instantly share code, notes, and snippets.

@DannyArends
Created February 12, 2012 16:13
Show Gist options
  • Select an option

  • Save DannyArends/1809392 to your computer and use it in GitHub Desktop.

Select an option

Save DannyArends/1809392 to your computer and use it in GitHub Desktop.
Unittests in D-coding repos

D-coding unittest, needs to import

    import std.stdio;
    import std.conv;
    import std.string;

The unittest layout:

    unittest{
      writeln("Unit test: ",__FILE__);
      try{
        <!-- CODE HERE -->
        writeln("OK: ",__FILE__);  
      }catch(Throwable e){
        string err = to!string(e).split("\n")[0];
        writefln(" - %s\nFAILED: %s",err,__FILE__);  
      }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment