Skip Menu |

This queue is for tickets about the Class-DBI-AsForm CPAN distribution.

Report information
The Basics
Id: 63623
Status: open
Priority: 0/
Queue: Class-DBI-AsForm

People
Owner: Nobody in particular
Requestors: CARNIL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Attachments


Subject: Tests fails when building with HTML::Tree (>= 4.0)
Date: Sun, 5 Dec 2010 16:23:01 +0100
To: bug-Class-DBI-AsForm [...] rt.cpan.org
From: Salvatore Bonaccorso <carnil [...] cpan.org>
Hi Building Class-DBI-AsForm with using HTML::Tree (>= 4.0) tests fail. This seems related to the following change in HTML::Tree 4.0: 4.0 Mon Sep 20 2010 [THINGS THAT MAY BREAK YOUR CODE OR TESTS] * Changes to entity encoding from ord values to XML entities may break tests expecting &#00; style encoding. * Attribute names are now validated in as_XML and invalid names will cause an error. The failures are: # Failed test 'Select OK' # at t/01.t line 43. # got: '<select name="bar"><option # value="1">Hi</option></select>' # expected: '<select name="bar"><option # value=1>Hi</option></select> # ' # Failed test 'All correct as an object method' # at t/01.t line 54. # Structures begin differing at: # $got->{bar} = '<select name="bar"><option selected # value="1">Hi</option></select>' # $expected->{bar} = '<select name="bar"><option selected # value=1>Hi</option></select> # ' # Looks like you failed 2 tests of 4. t/01.t ............ Dubious, test returned 2 (wstat 512, 0x200) Failed 2/4 subtests t/pod-coverage.t .. ok t/pod.t ........... ok Test Summary Report ------------------- t/01.t (Wstat: 512 Tests: 4 Failed: 2) Failed tests: 3-4 Non-zero exit status: 2 Files=3, Tests=6, 0 wallclock secs ( 0.02 usr 0.00 sys + 0.28 cusr 0.01 csys = 0.31 CPU) Result: FAIL Failed 1/3 test programs. 2/6 subtests failed. make[1]: *** [test_dynamic] Error 255 Bests and thanks! Salvatore
Download signature.asc
application/pgp-signature 835b

Message body not shown because it is not plain text.

From: ppisar [...] redhat.com
Dne Ne 05.pro.2010 10:23:12, CARNIL napsal(a): Show quoted text
> > Building Class-DBI-AsForm with using HTML::Tree (>= 4.0) tests fail.
[...] Show quoted text
> > The failures are: > > > # Failed test 'Select OK' > # at t/01.t line 43. > # got: '<select name="bar"><option > # value="1">Hi</option></select>' > # expected: '<select name="bar"><option > # value=1>Hi</option></select> > # ' > > # Failed test 'All correct as an object method' > # at t/01.t line 54. > # Structures begin differing at: > # $got->{bar} = '<select name="bar"><option selected > # value="1">Hi</option></select>' > # $expected->{bar} = '<select name="bar"><option selected > # value=1>Hi</option></select> > # ' > # Looks like you failed 2 tests of 4. > t/01.t ............ > Dubious, test returned 2 (wstat 512, 0x200) > Failed 2/4 subtests
This is partially (HTML/XHTML) covered in sibling bug RT#19802 with a patch (already needed for HTML-Tree-3.23). The other problem are trailing new lines. HTML-Tree-4.0 removes erroneous new lines, so one can use that patch, remove new lines and these tests will pass.
From: ppisar [...] redhat.com
Fix.
Subject: 0001-Adapt-to-formating-changes-in-HTML-Tree-4.0-RT-63623.patch
From ca3bb3bb3004396afa52ea9b3c99e9b5dd363576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 24 Jun 2011 12:12:50 +0200 Subject: [PATCH] Adapt to formating changes in HTML-Tree 4.0 (RT#63623) --- t/01.t | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-) diff --git a/t/01.t b/t/01.t index 96133ba..e26e83e 100644 --- a/t/01.t +++ b/t/01.t @@ -40,15 +40,12 @@ like(Foo->to_field("baz"), qr/<input .*name="baz"/, "Ordinary text field OK"); Foo->has_a(bar => Bar); -is(Foo->to_field("bar"), "<select name=\"bar\"><option value=1>Hi</option></select>\n", +is(Foo->to_field("bar"), "<select name=\"bar\"><option value=\"1\">Hi</option></select>", "Select OK"); my $x = bless({id => 1, bar => Bar->retrieve_all(), baz => "Hello there"}, "Foo"); -my %cgi = ( id => '<input name="id" type="text" value=1> -', - bar => '<select name="bar"><option selected value=1>Hi</option></select> -', - baz => '<input name="baz" type="text" value="Hello there"> -' +my %cgi = ( id => '<input name="id" type="text" value="1" />', + bar => '<select name="bar"><option selected value="1">Hi</option></select>', + baz => '<input name="baz" type="text" value="Hello there" />' ); is_deeply({$x->to_cgi}, \%cgi, "All correct as an object method"); -- 1.7.5.4