Tempfiles in unittests
H. S. Teoh
hsteoh at quickfur.ath.cx
Sun Mar 11 21:30:59 PDT 2012
On Sun, Mar 11, 2012 at 02:14:59PM -0700, Jonathan M Davis wrote:
> On Sunday, March 11, 2012 13:33:34 Magnus Lie Hetland wrote:
> > On 2012-03-10 17:10:52 +0000, Jonathan M Davis said:
> > >> Otherwise, this wouldn't have been a problem :)
> > >
> > > Then you'll probably have to write a wrapper function which just
> > > uses byLine and join to grab the string line by line and then put
> > > it back together again.
> > Indeed. Not a problem.
> >
> > Just surprised me that there wasn't a standard way of writing
> > file-related unit tests :)
>
> Well, most of the file-related unit tests in Phobos don't care much
> about the contents of the file, and if they do, it's becaus they're
> testing one of the functions for reading one (such as byLine or read),
> in which case, they're not looking to read in the whole file at once.
> So, as far as Phobos' unit tests are concerned, there's not really any
> need for what you're trying to do. That doesn't mean that it shouldn't
> be supported, but it just doesn't appear to have ever come up.
[...]
I think he's talking about unit tests in general D code, not unittests
in Phobos.
T
--
Heuristics are bug-ridden by definition. If they didn't have bugs, they'd be algorithms.
More information about the Digitalmars-d-learn
mailing list