On Fri, 1 Feb 2002, Alex Gough wrote:
> On Fri, 1 Feb 2002, Simon Glover wrote:
>
> > The enclosed patch implements the last of these, and adds tests for
> > PerlUndefs and PerlStrings (and implicitly PerlInts and PerlNums -
> > should we also add explicit tests for these?). I haven't added tests
>
> Yes.
In that case, we could use a bunch more tests in pmc.t, as most of the
PerlScalar functionality is currently being tested using PerlInts.
>
> > for arrays/hashes, as I'm unclear what, if anything, they should
> > actually be returning in this context.
>
> I'd imagine exactly the same as "@array" does in perl now, hashes
> are, er, more difficult.
OK.
> > + set P0, "\0"
> > + set S0, P0
> > + print P0
> > + print S0
>
> I don't think it's wise to output NULs, using C< eq S0, "\0" ...> is
> a better way.
Good point.
> > +output_is(<<"CODE", <<'OUTPUT', "undef-string");
> > + new P0, PerlUndef
> > + set S0, P0
> > + end
> > +CODE
> > +OUTPUT
>
> Having no output from a test is bad, as it is indistinguishable from a
> segfault (although the suite might note this now). Also we'll want to
> be very careful about testing PerlUndef once we've added warnings in.
Gah - I'm sure I meant to put a C< print S0 > in that test; though, as
with the NUL test, there's probably a better way to do this. Re warnings
and PerlUndef, I don't see too much of a problem - we simply change the
tests to test that we're producing the correct warnings.
I'll post a revised patch in the next day or two, once I'm back in front
of a proper terminal.
Simon