From: Marius Gavrilescu Date: Thu, 25 Dec 2014 20:34:36 +0000 (+0200) Subject: Fix tests X-Git-Tag: 5.200_001~17 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=d4b9a41af9be3575f07fe96d77ede6b4caf8dee5;p=html-element-library.git Fix tests --- diff --git a/Makefile.PL b/Makefile.PL index 60d6ffe..7d2fdb4 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,7 +17,8 @@ WriteMakefile( qw/File::Slurp 0 HTML::PrettyPrinter 0 HTML::TreeBuilder 0 - Test::More 0/, + Test::More 0 + Test::XML 0/, }, PREREQ_PM => { qw/Array::Group 0 diff --git a/t/TestUtils.pm b/t/TestUtils.pm deleted file mode 100644 index e4bb274..0000000 --- a/t/TestUtils.pm +++ /dev/null @@ -1,35 +0,0 @@ -package TestUtils; - -use HTML::PrettyPrinter; -use FileHandle; -use File::Slurp; - -require Exporter; -@ISA=qw(Exporter); -@EXPORT = qw(ptree html_dir strip_ws); - -sub html_dir { - 't/html/' -} - -sub ptree { - my $tree = shift or die 'must supply tree'; - my $out = shift or die 'must supply outfile'; - - my $hpp = HTML::PrettyPrinter->new - (tabify => 0, allow_forced_nl => 1, quote_attr => 1); - my $lines = $hpp->format($tree); - - write_file $out, @$lines; - join '', @$lines; -} - -sub strip_ws { - my($str)=@_; - - $str =~ s/\s+//g; - $str; -} - - -1; diff --git a/t/crunch.t b/t/crunch.t index 383d5ed..627ef2a 100644 --- a/t/crunch.t +++ b/t/crunch.t @@ -1,11 +1,9 @@ # This might look like shell script, but it's actually -*- perl -*- use strict;use warnings; -use lib qw(t/ t/m/); -use File::Slurp; +use File::Slurp qw/read_file/; use Test::More; -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; use Test::XML; @@ -16,17 +14,9 @@ sub tage { my $tree = HTML::TreeBuilder->new_from_file("$root.initial")->guts; - $tree->crunch(look_down => [ class => 'imageElement' ], leave => 1); - my $generated_html = strip_ws ( ptree($tree, "$root.gen") ); - # must put read_file() in scalar context so that a string instead of first line is returned. - my $expected_html = strip_ws(scalar File::Slurp::read_file("$root.exp")); - - #warn "g:$generated_html"; - #warn "e:$expected_html"; - - is ($generated_html, $expected_html, "HTML for crunch"); + is_xml $tree->as_XML, scalar read_file("$root.exp"), 'XML for crunch'; } diff --git a/t/defmap.t b/t/defmap.t index c26ab43..26eeeed 100644 --- a/t/defmap.t +++ b/t/defmap.t @@ -1,12 +1,10 @@ # This might look like shell script, but it's actually -*- perl -*- use strict;use warnings; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); use Test::XML; -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; @@ -22,11 +20,11 @@ sub tage { $tree->defmap(smap => \%data, 1); - my $g = ptree($tree, "$root.gen"); + my $g = $tree->as_XML; my $e = File::Slurp::read_file("$root.exp"); warn "generated:$g:\nexpected:$e:"; - is_xml ($g, $e, "HTML for defmap"); + is_xml ($g, $e, "XML for defmap"); } diff --git a/t/dual_iter.t b/t/dual_iter.t index dfe5b2f..dbcfb28 100644 --- a/t/dual_iter.t +++ b/t/dual_iter.t @@ -1,13 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; # this is a simpler call to iter2() @@ -47,7 +46,6 @@ $tree->iter2( ); - my $generated_html = ptree($tree, "$root.gen"); - is ($generated_html, File::Slurp::read_file("$root.exp"), - "HTML for generated li"); + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), + "XML for generated li"); diff --git a/t/fillinform.t b/t/fillinform.t index 3a6c0f2..d989f4e 100644 --- a/t/fillinform.t +++ b/t/fillinform.t @@ -1,13 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict;use warnings; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; sub tage { @@ -19,9 +18,7 @@ sub tage { my $new_tree = HTML::TreeBuilder->new_from_content( $tree->fillinform(\%data) ) ; - my $generated_html = ptree($new_tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for fillinform"); + is_xml ($new_tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "HTML for fillinform"); } diff --git a/t/hashmap.t b/t/hashmap.t index 285f64c..9ed2864 100644 --- a/t/hashmap.t +++ b/t/hashmap.t @@ -1,13 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; sub replace_age { my $branch = shift; @@ -29,15 +28,11 @@ sub tage { $tree->hash_map (hash => \%data, to_attr => 'sid', - excluding => [ 'email' ], - debug => 1 + excluding => [ 'email' ] ); - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for same_as"); + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "XML for same_as"); } tage(); - diff --git a/t/highlander.t b/t/highlander.t index 061cc5f..e9f754c 100644 --- a/t/highlander.t +++ b/t/highlander.t @@ -1,14 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; - +use Test::XML; sub tage { my $age = shift; @@ -27,9 +25,8 @@ sub tage { my $root = "t/html/highlander-$age"; - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for $age"); + local $_; # XML::Parser does not like read-only $_ (RT #101129) + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "XML for $age"); } diff --git a/t/highlander2.t b/t/highlander2.t index 479553f..c145b68 100644 --- a/t/highlander2.t +++ b/t/highlander2.t @@ -1,13 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; sub replace_age { my $branch = shift; @@ -41,9 +40,8 @@ sub tage { my $root = "t/html/highlander2-$age"; - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for $age"); + local $_; # XML::Parser does not like read-only $_ (RT #101129) + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "HTML for $age"); } diff --git a/t/html/crunch/crunch.exp b/t/html/crunch/crunch.exp index 5c5b118..272e334 100644 --- a/t/html/crunch/crunch.exp +++ b/t/html/crunch/crunch.exp @@ -1,30 +1,30 @@ - - - - - - - - - -
-
-

Item 1 Title

-

Item 1 Description

- - Item 1 Title thumbnail of Item 1 Title
-
- - + + + + + + + + + +
+
+

Item 1 Title

+

Item 1 Description

+ + Item 1 Title thumbnail of Item 1 Title
+
+ + diff --git a/t/html/crunch/crunch.gen b/t/html/crunch/crunch.gen deleted file mode 100644 index 5c5b118..0000000 --- a/t/html/crunch/crunch.gen +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - -
-
-

Item 1 Title

-

Item 1 Description

- - Item 1 Title thumbnail of Item 1 Title
-
- - diff --git a/t/html/defmap/defmap.gen b/t/html/defmap/defmap.gen deleted file mode 100644 index f5aabd8..0000000 --- a/t/html/defmap/defmap.gen +++ /dev/null @@ -1,5 +0,0 @@ - - Yes - arsenal rules - No - diff --git a/t/html/dual_iter.gen b/t/html/dual_iter.gen deleted file mode 100644 index 64c6c8f..0000000 --- a/t/html/dual_iter.gen +++ /dev/null @@ -1,15 +0,0 @@ - - - -
-
the pros
-
never have to worry about service again
-
the cons
-
upfront extra charge on purchase
-
our choice
-
go with the extended service plan
-
sample header
-
sample data
-
- - diff --git a/t/html/fillinform/fillinform.exp b/t/html/fillinform/fillinform.exp index ed123ac..bbe603e 100644 --- a/t/html/fillinform/fillinform.exp +++ b/t/html/fillinform/fillinform.exp @@ -5,18 +5,18 @@

Dialer

City: - +
State: - +
Company: - +
Data Source: - +
- +
diff --git a/t/html/fillinform/fillinform.gen b/t/html/fillinform/fillinform.gen deleted file mode 100644 index ed123ac..0000000 --- a/t/html/fillinform/fillinform.gen +++ /dev/null @@ -1,23 +0,0 @@ - - - -
-

Dialer

-
-
City: - -
-
State: - -
-
Company: - -
-
Data Source: - -
- -
-
- - diff --git a/t/html/fillinform/fillinform.initial b/t/html/fillinform/fillinform.initial index d0269d9..2661798 100644 --- a/t/html/fillinform/fillinform.initial +++ b/t/html/fillinform/fillinform.initial @@ -3,19 +3,19 @@
- City: + City:
- State: + State:
- Company: + Company:
- Data Source: -
+ Data Source: +
diff --git a/t/html/highlander-15.gen b/t/html/highlander-15.gen deleted file mode 100644 index 48fe062..0000000 --- a/t/html/highlander-15.gen +++ /dev/null @@ -1,6 +0,0 @@ - - - Sorry, - you're not old enough to enter (and too dumb to lie about your age) - - diff --git a/t/html/highlander-5.gen b/t/html/highlander-5.gen deleted file mode 100644 index 96df6fc..0000000 --- a/t/html/highlander-5.gen +++ /dev/null @@ -1,6 +0,0 @@ - - - Hello, - does your mother know you're using her AOL account? - - diff --git a/t/html/highlander-50.gen b/t/html/highlander-50.gen deleted file mode 100644 index 1f03edd..0000000 --- a/t/html/highlander-50.gen +++ /dev/null @@ -1,5 +0,0 @@ - - - Welcome - - diff --git a/t/html/highlander2-15.gen b/t/html/highlander2-15.gen deleted file mode 100644 index 20be935..0000000 --- a/t/html/highlander2-15.gen +++ /dev/null @@ -1,6 +0,0 @@ - - - Sorry, - you're only 15 (and too dumb to lie about your - age) - diff --git a/t/html/highlander2-27.gen b/t/html/highlander2-27.gen deleted file mode 100644 index dd7b2fa..0000000 --- a/t/html/highlander2-27.gen +++ /dev/null @@ -1,6 +0,0 @@ - - - Welcome, - isn't it good to be 27 years old? - - diff --git a/t/html/highlander2-5.gen b/t/html/highlander2-5.gen deleted file mode 100644 index b62e6e0..0000000 --- a/t/html/highlander2-5.gen +++ /dev/null @@ -1,6 +0,0 @@ - - - Hello, - little 5-year old, does your mother know you're - using her AOL account? - diff --git a/t/html/highlander2-passover.gen b/t/html/highlander2-passover.gen deleted file mode 100644 index 8de5305..0000000 --- a/t/html/highlander2-passover.gen +++ /dev/null @@ -1,6 +0,0 @@ - - - Sorry, - you're only AGE (and too dumb to lie about your - age) - diff --git a/t/html/iter.gen b/t/html/iter.gen deleted file mode 100644 index 746633e..0000000 --- a/t/html/iter.gen +++ /dev/null @@ -1,10 +0,0 @@ - - - Here are the things I need from the store: - - - diff --git a/t/html/iter2.gen b/t/html/iter2.gen deleted file mode 100644 index 17148cf..0000000 --- a/t/html/iter2.gen +++ /dev/null @@ -1,15 +0,0 @@ - - - Here are the type of people you meet at XYZ, inc: -
-
Programmer
-
one who likes Perl and Seamstress
-
DBA
-
one who does business as
-
Admin
-
one who plays Tetris all day
-
Poet
-
A relative of Edgar Allan Poe.
-
- - diff --git a/t/html/same_as/same_as.gen b/t/html/same_as/same_as.gen deleted file mode 100644 index 22486ba..0000000 --- a/t/html/same_as/same_as.gen +++ /dev/null @@ -1,15 +0,0 @@ - - - HO HO HA HA HA - - - - - - - - -
888444-4444should-not-be-touched@seamstress.com
- - diff --git a/t/html/table-alt.gen b/t/html/table-alt.gen deleted file mode 100644 index 60c9f06..0000000 --- a/t/html/table-alt.gen +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nameage weight
bob9999
bill1252
brian4480
babette52124
bobo12120
bix43230
- - diff --git a/t/html/table.gen b/t/html/table.gen deleted file mode 100644 index c11b8f4..0000000 --- a/t/html/table.gen +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nameage weight
bob9999
bill1252
brian4480
babette52124
bobo12120
bix43230
- - diff --git a/t/html/table2-table_ld-arrayref.exp b/t/html/table2-table_ld-arrayref.exp deleted file mode 100644 index 328a429..0000000 --- a/t/html/table2-table_ld-arrayref.exp +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-table_ld-arrayref.gen b/t/html/table2-table_ld-arrayref.gen deleted file mode 100644 index 328a429..0000000 --- a/t/html/table2-table_ld-arrayref.gen +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-table_ld-arrayref.html b/t/html/table2-table_ld-arrayref.html deleted file mode 100644 index cffaba2..0000000 --- a/t/html/table2-table_ld-arrayref.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Complex HTML Table - - - -

Complex HTML Table

- -

- This table comes from - - the w3 spec on tables - . I am using it to try out the table2() API call - that is part of the new release of - - HTML::Element::Library - . -

- - -

- - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID -
Name - ACP - OEMCP - Windows
NT 3.1 -
Windows
NT 3.51 -
Windows
95 -
1200Unicode (BMP of ISO/IEC-10646)XX* -
1250Windows 3.1 Eastern EuropeanXXXX -
1251Windows 3.1 CyrillicXXXX -
1252Windows 3.1 US (ANSI)XXXX -
1253Windows 3.1 GreekXXXX -
1254Windows 3.1 TurkishXXXX -
1255HebrewXX -
1256ArabicXX -
1257BalticXX -
1361Korean (Johab)X**X -
437MS-DOS United StatesXXXX -
708Arabic (ASMO 708)XX -
709Arabic (ASMO 449+, BCON V4)XX -
710Arabic (Transparent Arabic)XX -
720Arabic (Transparent ASMO)XX
- - - - -


-
metaperl
- - -Last modified: Fri Nov 25 08:57:41 PST 2005 - - - diff --git a/t/html/table2-table_ld-coderef.exp b/t/html/table2-table_ld-coderef.exp deleted file mode 100644 index 328a429..0000000 --- a/t/html/table2-table_ld-coderef.exp +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-table_ld-coderef.gen b/t/html/table2-table_ld-coderef.gen deleted file mode 100644 index 328a429..0000000 --- a/t/html/table2-table_ld-coderef.gen +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-table_ld-coderef.html b/t/html/table2-table_ld-coderef.html deleted file mode 100644 index cffaba2..0000000 --- a/t/html/table2-table_ld-coderef.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Complex HTML Table - - - -

Complex HTML Table

- -

- This table comes from - - the w3 spec on tables - . I am using it to try out the table2() API call - that is part of the new release of - - HTML::Element::Library - . -

- - -

- - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID -
Name - ACP - OEMCP - Windows
NT 3.1 -
Windows
NT 3.51 -
Windows
95 -
1200Unicode (BMP of ISO/IEC-10646)XX* -
1250Windows 3.1 Eastern EuropeanXXXX -
1251Windows 3.1 CyrillicXXXX -
1252Windows 3.1 US (ANSI)XXXX -
1253Windows 3.1 GreekXXXX -
1254Windows 3.1 TurkishXXXX -
1255HebrewXX -
1256ArabicXX -
1257BalticXX -
1361Korean (Johab)X**X -
437MS-DOS United StatesXXXX -
708Arabic (ASMO 708)XX -
709Arabic (ASMO 449+, BCON V4)XX -
710Arabic (Transparent Arabic)XX -
720Arabic (Transparent ASMO)XX
- - - - -


-
metaperl
- - -Last modified: Fri Nov 25 08:57:41 PST 2005 - - - diff --git a/t/html/table2-table_ld-default.exp b/t/html/table2-table_ld-default.exp deleted file mode 100644 index 328a429..0000000 --- a/t/html/table2-table_ld-default.exp +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-table_ld-default.gen b/t/html/table2-table_ld-default.gen deleted file mode 100644 index 328a429..0000000 --- a/t/html/table2-table_ld-default.gen +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-table_ld-default.html b/t/html/table2-table_ld-default.html deleted file mode 100644 index cffaba2..0000000 --- a/t/html/table2-table_ld-default.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Complex HTML Table - - - -

Complex HTML Table

- -

- This table comes from - - the w3 spec on tables - . I am using it to try out the table2() API call - that is part of the new release of - - HTML::Element::Library - . -

- - -

- - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID -
Name - ACP - OEMCP - Windows
NT 3.1 -
Windows
NT 3.51 -
Windows
95 -
1200Unicode (BMP of ISO/IEC-10646)XX* -
1250Windows 3.1 Eastern EuropeanXXXX -
1251Windows 3.1 CyrillicXXXX -
1252Windows 3.1 US (ANSI)XXXX -
1253Windows 3.1 GreekXXXX -
1254Windows 3.1 TurkishXXXX -
1255HebrewXX -
1256ArabicXX -
1257BalticXX -
1361Korean (Johab)X**X -
437MS-DOS United StatesXXXX -
708Arabic (ASMO 708)XX -
709Arabic (ASMO 449+, BCON V4)XX -
710Arabic (Transparent Arabic)XX -
720Arabic (Transparent ASMO)XX
- - - - -


-
metaperl
- - -Last modified: Fri Nov 25 08:57:41 PST 2005 - - - diff --git a/t/html/table2-table_ld.exp b/t/html/table2-table_ld.exp new file mode 100644 index 0000000..51d727c --- /dev/null +++ b/t/html/table2-table_ld.exp @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2-tr_ld-arrayref.gen b/t/html/table2-tr_ld-arrayref.gen deleted file mode 100644 index 0b96ad5..0000000 --- a/t/html/table2-tr_ld-arrayref.gen +++ /dev/null @@ -1,9 +0,0 @@ - - 437 - MS-DOS United States - - X - X - X - X - diff --git a/t/html/table2-tr_ld-arrayref.html b/t/html/table2-tr_ld-arrayref.html index 19e0c51..5784ee6 100644 --- a/t/html/table2-tr_ld-arrayref.html +++ b/t/html/table2-tr_ld-arrayref.html @@ -23,45 +23,42 @@

- +
- - - - + + + + - - + + + + + + + + - + - + @@ -74,7 +71,7 @@
metaperl
-Last modified: Fri Nov 25 19:38:43 PST 2005 +Last modified: Fri Nov 25 08:57:41 PST 2005 diff --git a/t/html/table2-tr_ld-coderef.exp b/t/html/table2-tr_ld-coderef.exp index 81399d8..6d1640a 100644 --- a/t/html/table2-tr_ld-coderef.exp +++ b/t/html/table2-tr_ld-coderef.exp @@ -19,13 +19,13 @@ - + - - - + + + @@ -124,7 +124,7 @@
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID -
Name - ACP - OEMCP - Windows
NT 3.1 -
Windows
NT 3.51 -
Windows
95 -
Code-Page
ID
NameACPOEMCPWindows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX* -
1250Windows 3.1 Eastern EuropeanXXXX -
1251Windows 3.1 CyrillicXXXX -
1252Windows 3.1 US (ANSI)XXXX -
1253Windows 3.1 GreekXXXX -
1254Windows 3.1 TurkishXXXX -
1255HebrewXX -
1256ArabicXX -
1257BalticXX -
1361Korean (Johab)X**X +
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX +
1251Windows 3.1 CyrillicXXXX +
1252Windows 3.1 US (ANSI)XXXX +
1253Windows 3.1 GreekXXXX +
1254Windows 3.1 TurkishXXXX +
1255HebrewXX +
1256ArabicXX +
1257BalticXX +
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX -
708Arabic (ASMO 708)XX -
709Arabic (ASMO 449+, BCON V4)XX -
710Arabic (Transparent Arabic)XX -
720Arabic (Transparent ASMO)XX
437MS-DOS United StatesXXXX +
708Arabic (ASMO 708)XX +
709Arabic (ASMO 449+, BCON V4)XX +
710Arabic (Transparent Arabic)XX +
720Arabic (Transparent ASMO)XX
Code-Page
ID
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
Windows
NT 3.1
Windows
NT 3.51
Windows
95
-


+
metaperl
Last modified: Fri Nov 25 08:57:41 PST 2005

diff --git a/t/html/table2-tr_ld-coderef.gen b/t/html/table2-tr_ld-coderef.gen deleted file mode 100644 index 81399d8..0000000 --- a/t/html/table2-tr_ld-coderef.gen +++ /dev/null @@ -1,131 +0,0 @@ - - - Complex HTML Table - - -

Complex HTML Table

-

This table comes from the - w3 spec on tables . I am using it to try out the - table2() API call that is part of the new release of - HTML::Element::Library .

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
-


-
metaperl
- Last modified: Fri Nov 25 08:57:41 PST 2005

- - diff --git a/t/html/table2-tr_ld-default.gen b/t/html/table2-tr_ld-default.gen deleted file mode 100644 index ed2919a..0000000 --- a/t/html/table2-tr_ld-default.gen +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX
1251Windows 3.1 CyrillicXXXX
1252Windows 3.1 US (ANSI)XXXX
1253Windows 3.1 GreekXXXX
1254Windows 3.1 TurkishXXXX
1255HebrewXX
1256ArabicXX
1257BalticXX
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX
708Arabic (ASMO 708)XX
709Arabic (ASMO 449+, BCON V4)XX
710Arabic (Transparent Arabic)XX
720Arabic (Transparent ASMO)XX
diff --git a/t/html/table2.exp b/t/html/table2.exp index db2e10b..816c4bb 100644 --- a/t/html/table2.exp +++ b/t/html/table2.exp @@ -19,13 +19,13 @@ - Code-Page
ID + Code-Page
ID Name ACP OEMCP - Windows
NT 3.1 - Windows
NT 3.51 - Windows
95 + Windows
NT 3.1 + Windows
NT 3.51 + Windows
95 @@ -169,7 +169,7 @@ -
+
metaperl
Last modified: Fri Nov 25 08:57:41 PST 2005

diff --git a/t/html/table2.gen b/t/html/table2.gen deleted file mode 100644 index db2e10b..0000000 --- a/t/html/table2.gen +++ /dev/null @@ -1,176 +0,0 @@ - - - Complex HTML Table - - -

Complex HTML Table

-

This table comes from the - w3 spec on tables . I am using it to try out the - table2() API call that is part of the new release of - HTML::Element::Library .

-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID
Name ACP OEMCP Windows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO 10646)00112
1250Windows 3.1 Eastern European10111
1251Windows 3.1 Cyrillic10111
1252Windows 3.1 US (ANSI)10111
1253Windows 3.1 Greek10111
1254Windows 3.1 Turkish10111
1255Hebrew10001
1256Arabic10001
1257Baltic10001
1361Korean (Johab)10031
437MS-DOSUnited States0111
708Arabic (ASMO 708)01001
709Arabic (ASMO 449+ BCON V4)01001
710Arabic (Transparent Arabic)01001
720Arabic (Transparent ASMO)01001
-


-
metaperl
- Last modified: Fri Nov 25 08:57:41 PST 2005

- - diff --git a/t/html/table2.html b/t/html/table2.html index cffaba2..77c5ff8 100644 --- a/t/html/table2.html +++ b/t/html/table2.html @@ -25,41 +25,40 @@ - - - - + + + + - - + + + + + + + + - + - + diff --git a/t/html/unroll_select.exp b/t/html/unroll_select.exp index f6a977e..521644d 100644 --- a/t/html/unroll_select.exp +++ b/t/html/unroll_select.exp @@ -5,18 +5,18 @@

signup

- +
CODE-PAGE SUPPORT IN MICROSOFT WINDOWS
Code-Page
ID -
Name - ACP - OEMCP - Windows
NT 3.1 -
Windows
NT 3.51 -
Windows
95 -
Code-Page
ID
NameACPOEMCPWindows
NT 3.1
Windows
NT 3.51
Windows
95
1200Unicode (BMP of ISO/IEC-10646)XX* -
1250Windows 3.1 Eastern EuropeanXXXX -
1251Windows 3.1 CyrillicXXXX -
1252Windows 3.1 US (ANSI)XXXX -
1253Windows 3.1 GreekXXXX -
1254Windows 3.1 TurkishXXXX -
1255HebrewXX -
1256ArabicXX -
1257BalticXX -
1361Korean (Johab)X**X +
1200Unicode (BMP of ISO/IEC-10646)XX*
1250Windows 3.1 Eastern EuropeanXXXX +
1251Windows 3.1 CyrillicXXXX +
1252Windows 3.1 US (ANSI)XXXX +
1253Windows 3.1 GreekXXXX +
1254Windows 3.1 TurkishXXXX +
1255HebrewXX +
1256ArabicXX +
1257BalticXX +
1361Korean (Johab)X**X
437MS-DOS United StatesXXXX -
708Arabic (ASMO 708)XX -
709Arabic (ASMO 449+, BCON V4)XX -
710Arabic (Transparent Arabic)XX -
720Arabic (Transparent ASMO)XX
437MS-DOS United StatesXXXX +
708Arabic (ASMO 708)XX +
709Arabic (ASMO 449+, BCON V4)XX +
710Arabic (Transparent Arabic)XX +
720Arabic (Transparent ASMO)XX
@@ -32,23 +32,23 @@
Screen Name - +
Login Name (use this to login next time) - +
Password (Don't choose one you use elsewhere.) - +
Password (Again) - +
Email - +
- + diff --git a/t/html/unroll_select.gen b/t/html/unroll_select.gen deleted file mode 100644 index f6a977e..0000000 --- a/t/html/unroll_select.gen +++ /dev/null @@ -1,54 +0,0 @@ - - - ctf gimble challenge ladder - signup - - -

signup

-
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Screen Name - -
Login Name (use this to login next time) - -
Clan Name - -
Password (Don't choose one you use elsewhere.) - -
Password (Again) - -
Email - -
- -
- - diff --git a/t/html/unroll_select.html b/t/html/unroll_select.html index e9ac45c..eeb0a63 100644 --- a/t/html/unroll_select.html +++ b/t/html/unroll_select.html @@ -10,18 +10,18 @@
- + - + - + @@ -34,23 +34,23 @@ - + - + - +
Screen Name
Login Name (use this to login next time)
Password (Don't choose one you use elsewhere.)
Password (Again)
Email
- +
- \ No newline at end of file + diff --git a/t/iter.t b/t/iter.t index fe064e0..182abd1 100644 --- a/t/iter.t +++ b/t/iter.t @@ -1,14 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); - use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; my $root = 't/html/iter'; @@ -20,7 +18,6 @@ my @items = qw(bread butter vodka); $tree->iter($li, @items); - my $generated_html = ptree($tree, "$root.gen"); - is ($generated_html, File::Slurp::read_file("$root.exp"), +is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "HTML for generated li"); diff --git a/t/iter2.t b/t/iter2.t index 1a79501..8f3f312 100644 --- a/t/iter2.t +++ b/t/iter2.t @@ -1,14 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); - use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; my $root = 't/html/iter2'; @@ -42,7 +40,4 @@ $tree->iter2( ); - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), - "HTML for generated li"); +is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "XML for generated li"); diff --git a/t/m/TestUtils.pm b/t/m/TestUtils.pm deleted file mode 100644 index e5f2b69..0000000 --- a/t/m/TestUtils.pm +++ /dev/null @@ -1,31 +0,0 @@ -package TestUtils; - -use HTML::PrettyPrinter; -use FileHandle; -use File::Slurp; - -use Carp qw(carp cluck croak confess); - -require Exporter; -@ISA=qw(Exporter); -@EXPORT = qw(ptree html_dir); - -sub html_dir { - 't/html/' -} - -sub ptree { - my $tree = shift or confess 'must supply tree'; - my $out = shift or confess 'must supply outfile'; - - my $hpp = HTML::PrettyPrinter->new - (tabify => 0, allow_forced_nl => 1, quote_attr => 1); - my $lines = $hpp->format($tree); - - write_file $out, @$lines; - join '', @$lines; -} - - - -1; diff --git a/t/passover.t b/t/passover.t index 2ba1b35..09951ab 100644 --- a/t/passover.t +++ b/t/passover.t @@ -1,13 +1,12 @@ # This might look like shell script, but it's actually -*- perl -*- use strict; -use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; sub replace_age { my $branch = shift; @@ -25,9 +24,7 @@ sub tage { my $root = "t/html/highlander2-passover"; - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), "HTML for $age"); + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "XML for $age"); } diff --git a/t/table-alt.t b/t/table-alt.t index 2880b48..9b84079 100644 --- a/t/table-alt.t +++ b/t/table-alt.t @@ -6,9 +6,9 @@ use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; use SimpleClass; @@ -50,7 +50,5 @@ $tree->table ); - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "HTML for non-alternating table"); diff --git a/t/table.t b/t/table.t index 54ff6a2..2351038 100644 --- a/t/table.t +++ b/t/table.t @@ -6,9 +6,9 @@ use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; use SimpleClass; @@ -50,7 +50,5 @@ $tree->table ); - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), + is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "HTML for non-alternating table"); diff --git a/t/table2-table_ld.t b/t/table2-table_ld.t index 3b3942b..c53735a 100644 --- a/t/table2-table_ld.t +++ b/t/table2-table_ld.t @@ -11,9 +11,9 @@ use lib qw(t/ t/m/); use File::Slurp; use Test::More; -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; use data::table2; @@ -22,7 +22,7 @@ my $o = data::table2->new; # a - default table_ld -my $root = 't/html/table2-table_ld-default'; +my $root = 't/html/table2'; my $tree = HTML::TreeBuilder->new_from_file("$root.html"); @@ -31,13 +31,10 @@ my $table = HTML::Element::Library::ref_or_ld( ['_tag' => 'table'] ); -my $generated_html = ptree($table, "$root.gen"); - -is ($generated_html, File::Slurp::read_file("$root.exp"), $root); +is_xml ($table->as_XML, scalar File::Slurp::read_file("$root-table_ld.exp"), $root); # b - arrayref table_ld -$root = 't/html/table2-table_ld-arrayref'; $tree = HTML::TreeBuilder->new_from_file("$root.html"); @@ -46,13 +43,10 @@ $table = HTML::Element::Library::ref_or_ld( [frame => 'hsides', rules => 'groups'] ); -$generated_html = ptree($table, "$root.gen"); - -is ($generated_html, File::Slurp::read_file("$root.exp"), $root); +is_xml ($table->as_XML, scalar File::Slurp::read_file("$root-table_ld.exp"), $root); # c - coderef table_ld -$root = 't/html/table2-table_ld-coderef'; $tree = HTML::TreeBuilder->new_from_file("$root.html"); @@ -65,9 +59,7 @@ $table = HTML::Element::Library::ref_or_ld( } ); -$generated_html = ptree($table, "$root.gen"); - -is ($generated_html, File::Slurp::read_file("$root.exp"), $root); +is_xml ($table->as_XML, scalar File::Slurp::read_file("$root-table_ld.exp"), $root); done_testing; diff --git a/t/table2-tr_ld.t b/t/table2-tr_ld.t index 8e364ec..6e01c51 100644 --- a/t/table2-tr_ld.t +++ b/t/table2-tr_ld.t @@ -11,10 +11,10 @@ use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; use Scalar::Listify; +use Test::XML; use data::table2; @@ -23,7 +23,7 @@ my $o = data::table2->new; # a - default table_ld -my $root = 't/html/table2-tr_ld-default'; +my $root = 't/html/table2'; my $tree = HTML::TreeBuilder->new_from_file("$root.html"); @@ -45,14 +45,12 @@ my $tr = HTML::Element::Library::ref_or_ld( [class => 'findMe'] ); -my $generated_html = ptree($tr, "$root.gen"); - -is ($generated_html, File::Slurp::read_file("$root.exp"), $root); +is_xml ($tr->as_XML, scalar File::Slurp::read_file("$root.exp"), $root); # c - coderef tr_ld # removes windows listings before returning @tr -$root = 't/html/table2-tr_ld-coderef'; +$root = 't/html/table2'; $tree = HTML::TreeBuilder->new_from_file("$root.html"); @@ -81,7 +79,4 @@ $tree = HTML::TreeBuilder->new_from_file("$root.html"); #warn $_->as_HTML, $/ for @tr; -$generated_html = ptree($tree, "$root.gen"); - -is ($generated_html, File::Slurp::read_file("$root.exp"), $root); - +is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root-tr_ld-coderef.exp"), $root); diff --git a/t/table2.t b/t/table2.t index a8bff3e..f72096e 100644 --- a/t/table2.t +++ b/t/table2.t @@ -7,11 +7,10 @@ use File::Slurp; use Test::More; use Test::XML; -use TestUtils; - use Data::Dumper; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; use data::table2; @@ -47,9 +46,7 @@ for my $dataset (keys %$d) { } -my $generated_html = ptree($tree, "$root.gen"); - -is($generated_html, File::Slurp::read_file("$root.exp"), 'genhtml'); +is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), 'genhtml'); done_testing; diff --git a/t/unroll_select.t b/t/unroll_select.t index 90b87b7..a21c712 100644 --- a/t/unroll_select.t +++ b/t/unroll_select.t @@ -6,9 +6,9 @@ use lib qw(t/ t/m/); use File::Slurp; use Test::More qw(no_plan); -use TestUtils; use HTML::TreeBuilder; use HTML::Element::Library; +use Test::XML; use SelectData; @@ -27,7 +27,5 @@ $tree->unroll_select data_iter => sub { my $data = shift; shift @$data } ); - my $generated_html = ptree($tree, "$root.gen"); - - is ($generated_html, File::Slurp::read_file("$root.exp"), +is_xml ($tree->as_XML, scalar File::Slurp::read_file("$root.exp"), "HTML for non-alternating table");