DUnit: Advanced unit testing toolkit.

Gary Willoughby dev at nomad.so
Thu Sep 26 11:18:52 PDT 2013


On Wednesday, 25 September 2013 at 21:00:00 UTC, Jacob Carlborg 
wrote:
> There are property functions at line 374 and below to set the 
> assert handler.

Only the deprecated version works as expected.

import core.exception;
import std.stdio;

alias void function(string file, size_t line, string msg) 
AssertHandler;

AssertHandler handler = function(string file, size_t line, string 
msg)
{
	writefln("File: %s", file);
	writefln("Line: %s", line);
	writefln("Message: %s", msg);
};

void main(string[] args)
{
	// assertHandler = handler; // <--- Private!
	setAssertHandler(handler); // <--- Works but deprecated

	assert(false, "Test message.");
}


More information about the Digitalmars-d-announce mailing list