Mercurial > projects > ldc
diff tangotests/q.d @ 134:0dec7b3727ea trunk
[svn r138] forgot the latest tests
author | lindquist |
---|---|
date | Mon, 14 Jan 2008 05:32:24 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tangotests/q.d Mon Jan 14 05:32:24 2008 +0100 @@ -0,0 +1,22 @@ +class E : Exception +{ + this(char[] msg) + { + super(msg); + } + + char[] toString() + { + return super.toString(); + } +} + +extern(C) int printf(char*, ...); + +void main() +{ + auto e = new E("hello world"); + auto msg = e.toString(); + printf("message should be: '%.*s'\n", msg.length, msg.ptr); + throw e; +}