On Tuesday, April 02, 2013 20:41:23 Walter Bright wrote: > On 4/2/2013 8:03 PM, Jonathan M Davis wrote: > > Too many of them just test a few cases to make sure that the most > > obvious stuff works rather than making sure they test corner cases and > > whatnot. > Currently, the datetime unittest coverage is 95%. Some of the 0 cases > suggest low hanging fruit. > > Despite what I just said, datetime has one of the highest unittest coverages > of any phobos module. Pretty much all of the phobos module unittest > coverage testing indicates more work is needed. > > Minor perf improvement: the order of the tests in yearIsLeapYear() should be > reversed, especially since signed divide is a very slow operation, and it > is called 20 million times by the unittests!!!
Yes. That's one of the things that I need to improve. std.datetime has a lot of tests, so it needs to do a better job of ordering stuff within unittest blocks in a manner which minimizes their cost. They need to be thorough, but they should also efficient, or the tests will end up taking too long (which is why it doensn't do a lot of testing with exceptions right now, since they slow the tests down considerably). - Jonathan M Davis