[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: format compact and loose
From: |
Ben Abbott |
Subject: |
Re: format compact and loose |
Date: |
Sun, 11 Sep 2011 14:20:35 -0400 |
On Sep 8, 2011, at 11:46 AM, Jordi Gutiérrez Hermoso wrote:
> On 8 September 2011 10:31, Ben Abbott <address@hidden> wrote:
>> On Sep 7, 2011, at 7:54 AM, bpabbott wrote:
>>
>>> On Sep 06, 2011, at 10:18 PM, Jordi Gutiérrez Hermoso <address@hidden>
>>> wrote:
>>>
>>> Thanks Jordi,
>>>
>>> In my spare time, I'll start writing test scripts for different classes.
>>>
>>> Ben
>>
>> Does this look like a reasonable approach?
>>
>> Ben
>>
>> diff --git a/src/pr-output.cc b/src/pr-output.cc
>> --- a/src/pr-output.cc
>> +++ b/src/pr-output.cc
>> @@ -3547,6 +3547,21 @@
>> %! endfor
>> %! endfor
>> %! fclose (fd);
>> +
>> +%!test
>> +%! foo.real = pi * ones (3,20,3);
>> +%! foo.complex = pi * ones (3,20,3) + 1i;
>> +%! foo.char = repmat ("- Hello World -", [3, 20]);
>> +%! foo.cell = {foo.real, foo.complex, foo.char};
>> +%! fields = fieldnames (foo);
>> +%! for f = 1:numel(fields)
>> +%! format loose
>> +%! loose = disp (foo.(fields{f}));
>> +%! format compact
>> +%! compact = disp (foo.(fields{f}));
>> +%! expected = strrep (loose, "\n\n", "\n");
>> +%! assert (expected, compact)
>> +%! endfor
>> */
>
> I think so. The test fails on stable but passes on dev. I say you push
> it, but perhaps wait a little while in case someone else finds fault
> with it.
>
> - Jordi G. H.
I pushed this changeset.
Ben
Re: format compact and loose, Zbigniew Komarnicki, 2011/09/07