Le 2010-07-15 à 22:52, Sean Kelly a écrit :

> It wouldn't be terribly onerous to me to break stateless tests into multiple 
> unittest blocks, but it's probably more readable to simply have:
> 
>    unittest {
>        verify(sort("bac") == "abc");
>        verify(sort("bba") == "abb");
>        ...
>    }

Perhaps the syntax for one-statement unit tests could be relaxed to not require 
the braces. This:

        unittest { assert(sort("bac") == "abc"); }
        unittest { assert(sort("bba") == "abc"); }

could become this:

        unittest assert(sort("bac") == "abc");
        unittest assert(sort("bba") == "abc");

And it's suddenly more elegant, more readable and easier to write. No need for 
a new kind of assert (your 'verify') or a non-throwing mode for asserts. It 
reminds me of what happened to enum.

But of course, that's probably more work to do in the compiler.

-- 
Michel Fortin
[email protected]
http://michelf.com/



_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to