Mailing List Archive

Re: [8516] Fixed bug where extra newlines after a =begin without a default
On Mar 23, 2009, at 8:17 PM, brewt@bricolage.cc wrote:

> Modified: bricolage/trunk/t/Bric/Biz/Element/Container/DevTest.pm
> ===================================================================
> --- bricolage/trunk/t/Bric/Biz/Element/Container/DevTest.pm
> 2009-03-20 15:56:20 UTC (rev 8515)
> +++ bricolage/trunk/t/Bric/Biz/Element/Container/DevTest.pm
> 2009-03-24 00:17:15 UTC (rev 8516)
> @@ -596,7 +596,7 @@
>
> ##############################################################################
> # Test pod.
> -sub test_pod : Test(227) {
> +sub test_pod : Test(229) {
> my $self = shift->create_element_types;
> my $story_type = $self->{story_type};
> my $para = $self->{para};
> @@ -747,6 +747,12 @@
> is $pq->get_value('by'), 'John F. Kennedy', 'Check pull quote by';
> is $pq->get_value('date'), '1961-01-20 00:00:00', 'Check pull
> quote date';
>
> + my $orig_pod = $self->pod_output;
> + (my $mod_pod = $orig_pod) =~ s/(=begin _pull_quote_)/$1\n/g;
> + ok $elem->update_from_pod($mod_pod),
> + "Update from POD with extra newlines after a =begin without
> a default";
> + is $self->pod_output, $orig_pod, 'Resulting POD should be the
> same';
> +
> # Try deserializeing with a default field.
> (my $stripped_pod = $self->pod_output) =~ s/(?: )?=para\n\n//g;
> ok $elem->update_from_pod($stripped_pod, 'para'),
>

OMG, you added a test! You ROCK! Thanks!

David
Re: [8516] Fixed bug where extra newlines after a =begin without a default [ In reply to ]
Yeah, it was a bit of a bitch to add one in at first since the tests
seemed to be dependent on previous tests. So when I tried adding or
modifying elements would break future tests.

Oops, forgot to add in a comment above that block of test to describe it.

Adrian

David E. Wheeler wrote:
> On Mar 23, 2009, at 8:17 PM, brewt@bricolage.cc wrote:
>
>> Modified: bricolage/trunk/t/Bric/Biz/Element/Container/DevTest.pm
>> ===================================================================
>> --- bricolage/trunk/t/Bric/Biz/Element/Container/DevTest.pm
>> 2009-03-20 15:56:20 UTC (rev 8515)
>> +++ bricolage/trunk/t/Bric/Biz/Element/Container/DevTest.pm
>> 2009-03-24 00:17:15 UTC (rev 8516)
>> @@ -596,7 +596,7 @@
>>
>> ##############################################################################
>>
>> # Test pod.
>> -sub test_pod : Test(227) {
>> +sub test_pod : Test(229) {
>> my $self = shift->create_element_types;
>> my $story_type = $self->{story_type};
>> my $para = $self->{para};
>> @@ -747,6 +747,12 @@
>> is $pq->get_value('by'), 'John F. Kennedy', 'Check pull quote by';
>> is $pq->get_value('date'), '1961-01-20 00:00:00', 'Check pull
>> quote date';
>>
>> + my $orig_pod = $self->pod_output;
>> + (my $mod_pod = $orig_pod) =~ s/(=begin _pull_quote_)/$1\n/g;
>> + ok $elem->update_from_pod($mod_pod),
>> + "Update from POD with extra newlines after a =begin without a
>> default";
>> + is $self->pod_output, $orig_pod, 'Resulting POD should be the same';
>> +
>> # Try deserializeing with a default field.
>> (my $stripped_pod = $self->pod_output) =~ s/(?: )?=para\n\n//g;
>> ok $elem->update_from_pod($stripped_pod, 'para'),
>>
>
> OMG, you added a test! You ROCK! Thanks!
>
> David
>
>
Re: [8516] Fixed bug where extra newlines after a =begin without a default [ In reply to ]
On Mar 24, 2009, at 12:20 AM, Adrian Yee wrote:

> Yeah, it was a bit of a bitch to add one in at first since the tests
> seemed to be dependent on previous tests. So when I tried adding or
> modifying elements would break future tests.

Yeah, I built them up over time. They were hard to write, but were
essential as I developed the bulk edit feature.

> Oops, forgot to add in a comment above that block of test to
> describe it.

Yes, that would be useful.

Thanks,

David