This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Fri, 9 Feb 2007 12:25:37 +0000 (12:25 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 9 Feb 2007 12:25:37 +0000 (12:25 +0000)
[ 28619]
Added tests from CGI.pm that had not been integrated into core.
p4raw-link: @28619 on //depot/perl: 9ae4231fec23eab01ed1d777fb74f1070512d4d7

p4raw-id: //depot/maint-5.8/perl@30179
p4raw-branched: from //depot/perl@30176 'branch in'
lib/CGI/t/start_end_asterisk.t lib/CGI/t/start_end_end.t
lib/CGI/t/start_end_start.t
p4raw-integrated: from //depot/perl@28619 'merge in' MANIFEST
(@28616..)

MANIFEST
lib/CGI/t/start_end_asterisk.t [new file with mode: 0644]
lib/CGI/t/start_end_end.t [new file with mode: 0644]
lib/CGI/t/start_end_start.t [new file with mode: 0644]

index 6a60143..605317d 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1286,6 +1286,9 @@ lib/CGI/t/no_tabindex.t   See if CGI.pm works
 lib/CGI/t/pretty.t             See if CGI.pm works
 lib/CGI/t/push.t               See if CGI::Push works
 lib/CGI/t/request.t            See if CGI.pm works
+lib/CGI/t/start_end_asterisk.t See if CGI.pm works
+lib/CGI/t/start_end_end.t      See if CGI.pm works
+lib/CGI/t/start_end_start.t    See if CGI.pm works
 lib/CGI/t/switch.t             See if CGI::Switch still loads
 lib/CGI/t/util-58.t            See if 5.8-dependent features work
 lib/CGI/t/util.t               See if CGI.pm works
diff --git a/lib/CGI/t/start_end_asterisk.t b/lib/CGI/t/start_end_asterisk.t
new file mode 100644 (file)
index 0000000..0d67c9d
--- /dev/null
@@ -0,0 +1,72 @@
+#!/usr/local/bin/perl -w
+
+use lib qw(t/lib);
+use strict;
+
+# Due to a bug in older versions of MakeMaker & Test::Harness, we must
+# ensure the blib's are in @INC, else we might use the core CGI.pm
+use lib qw(blib/lib blib/arch);
+use Test::More tests => 45;
+
+use CGI qw(:standard *h1 *h2 *h3 *h4 *h5 *h6 *table *ul *li *ol *td *b *i *u *div);
+
+is(start_h1(), "<h1>", "start_h1"); # TEST
+is(start_h1({class => 'hello'}), "<h1 class=\"hello\">", "start_h1 with param"); # TEST
+is(end_h1(), "</h1>", "end_h1"); # TEST
+
+is(start_h2(), "<h2>", "start_h2"); # TEST
+is(start_h2({class => 'hello'}), "<h2 class=\"hello\">", "start_h2 with param"); # TEST
+is(end_h2(), "</h2>", "end_h2"); # TEST
+
+is(start_h3(), "<h3>", "start_h3"); # TEST
+is(start_h3({class => 'hello'}), "<h3 class=\"hello\">", "start_h3 with param"); # TEST
+is(end_h3(), "</h3>", "end_h3"); # TEST
+
+is(start_h4(), "<h4>", "start_h4"); # TEST
+is(start_h4({class => 'hello'}), "<h4 class=\"hello\">", "start_h4 with param"); # TEST
+is(end_h4(), "</h4>", "end_h4"); # TEST
+
+is(start_h5(), "<h5>", "start_h5"); # TEST
+is(start_h5({class => 'hello'}), "<h5 class=\"hello\">", "start_h5 with param"); # TEST
+is(end_h5(), "</h5>", "end_h5"); # TEST
+
+is(start_h6(), "<h6>", "start_h6"); # TEST
+is(start_h6({class => 'hello'}), "<h6 class=\"hello\">", "start_h6 with param"); # TEST
+is(end_h6(), "</h6>", "end_h6"); # TEST
+
+is(start_table(), "<table>", "start_table"); # TEST
+is(start_table({class => 'hello'}), "<table class=\"hello\">", "start_table with param"); # TEST
+is(end_table(), "</table>", "end_table"); # TEST
+
+is(start_ul(), "<ul>", "start_ul"); # TEST
+is(start_ul({class => 'hello'}), "<ul class=\"hello\">", "start_ul with param"); # TEST
+is(end_ul(), "</ul>", "end_ul"); # TEST
+
+is(start_li(), "<li>", "start_li"); # TEST
+is(start_li({class => 'hello'}), "<li class=\"hello\">", "start_li with param"); # TEST
+is(end_li(), "</li>", "end_li"); # TEST
+
+is(start_ol(), "<ol>", "start_ol"); # TEST
+is(start_ol({class => 'hello'}), "<ol class=\"hello\">", "start_ol with param"); # TEST
+is(end_ol(), "</ol>", "end_ol"); # TEST
+
+is(start_td(), "<td>", "start_td"); # TEST
+is(start_td({class => 'hello'}), "<td class=\"hello\">", "start_td with param"); # TEST
+is(end_td(), "</td>", "end_td"); # TEST
+
+is(start_b(), "<b>", "start_b"); # TEST
+is(start_b({class => 'hello'}), "<b class=\"hello\">", "start_b with param"); # TEST
+is(end_b(), "</b>", "end_b"); # TEST
+
+is(start_i(), "<i>", "start_i"); # TEST
+is(start_i({class => 'hello'}), "<i class=\"hello\">", "start_i with param"); # TEST
+is(end_i(), "</i>", "end_i"); # TEST
+
+is(start_u(), "<u>", "start_u"); # TEST
+is(start_u({class => 'hello'}), "<u class=\"hello\">", "start_u with param"); # TEST
+is(end_u(), "</u>", "end_u"); # TEST
+
+is(start_div(), "<div>", "start_div"); # TEST
+is(start_div({class => 'hello'}), "<div class=\"hello\">", "start_div with param"); # TEST
+is(end_div(), "</div>", "end_div"); # TEST
+
diff --git a/lib/CGI/t/start_end_end.t b/lib/CGI/t/start_end_end.t
new file mode 100644 (file)
index 0000000..2eeed60
--- /dev/null
@@ -0,0 +1,72 @@
+#!/usr/local/bin/perl -w
+
+use lib qw(t/lib);
+use strict;
+
+# Due to a bug in older versions of MakeMaker & Test::Harness, we must
+# ensure the blib's are in @INC, else we might use the core CGI.pm
+use lib qw(blib/lib blib/arch);
+use Test::More tests => 45;
+
+use CGI qw(:standard end_h1 end_h2 end_h3 end_h4 end_h5 end_h6 end_table end_ul end_li end_ol end_td end_b end_i end_u end_div);
+
+is(start_h1(), "<h1>", "start_h1"); # TEST
+is(start_h1({class => 'hello'}), "<h1 class=\"hello\">", "start_h1 with param"); # TEST
+is(end_h1(), "</h1>", "end_h1"); # TEST
+
+is(start_h2(), "<h2>", "start_h2"); # TEST
+is(start_h2({class => 'hello'}), "<h2 class=\"hello\">", "start_h2 with param"); # TEST
+is(end_h2(), "</h2>", "end_h2"); # TEST
+
+is(start_h3(), "<h3>", "start_h3"); # TEST
+is(start_h3({class => 'hello'}), "<h3 class=\"hello\">", "start_h3 with param"); # TEST
+is(end_h3(), "</h3>", "end_h3"); # TEST
+
+is(start_h4(), "<h4>", "start_h4"); # TEST
+is(start_h4({class => 'hello'}), "<h4 class=\"hello\">", "start_h4 with param"); # TEST
+is(end_h4(), "</h4>", "end_h4"); # TEST
+
+is(start_h5(), "<h5>", "start_h5"); # TEST
+is(start_h5({class => 'hello'}), "<h5 class=\"hello\">", "start_h5 with param"); # TEST
+is(end_h5(), "</h5>", "end_h5"); # TEST
+
+is(start_h6(), "<h6>", "start_h6"); # TEST
+is(start_h6({class => 'hello'}), "<h6 class=\"hello\">", "start_h6 with param"); # TEST
+is(end_h6(), "</h6>", "end_h6"); # TEST
+
+is(start_table(), "<table>", "start_table"); # TEST
+is(start_table({class => 'hello'}), "<table class=\"hello\">", "start_table with param"); # TEST
+is(end_table(), "</table>", "end_table"); # TEST
+
+is(start_ul(), "<ul>", "start_ul"); # TEST
+is(start_ul({class => 'hello'}), "<ul class=\"hello\">", "start_ul with param"); # TEST
+is(end_ul(), "</ul>", "end_ul"); # TEST
+
+is(start_li(), "<li>", "start_li"); # TEST
+is(start_li({class => 'hello'}), "<li class=\"hello\">", "start_li with param"); # TEST
+is(end_li(), "</li>", "end_li"); # TEST
+
+is(start_ol(), "<ol>", "start_ol"); # TEST
+is(start_ol({class => 'hello'}), "<ol class=\"hello\">", "start_ol with param"); # TEST
+is(end_ol(), "</ol>", "end_ol"); # TEST
+
+is(start_td(), "<td>", "start_td"); # TEST
+is(start_td({class => 'hello'}), "<td class=\"hello\">", "start_td with param"); # TEST
+is(end_td(), "</td>", "end_td"); # TEST
+
+is(start_b(), "<b>", "start_b"); # TEST
+is(start_b({class => 'hello'}), "<b class=\"hello\">", "start_b with param"); # TEST
+is(end_b(), "</b>", "end_b"); # TEST
+
+is(start_i(), "<i>", "start_i"); # TEST
+is(start_i({class => 'hello'}), "<i class=\"hello\">", "start_i with param"); # TEST
+is(end_i(), "</i>", "end_i"); # TEST
+
+is(start_u(), "<u>", "start_u"); # TEST
+is(start_u({class => 'hello'}), "<u class=\"hello\">", "start_u with param"); # TEST
+is(end_u(), "</u>", "end_u"); # TEST
+
+is(start_div(), "<div>", "start_div"); # TEST
+is(start_div({class => 'hello'}), "<div class=\"hello\">", "start_div with param"); # TEST
+is(end_div(), "</div>", "end_div"); # TEST
+
diff --git a/lib/CGI/t/start_end_start.t b/lib/CGI/t/start_end_start.t
new file mode 100644 (file)
index 0000000..94768c1
--- /dev/null
@@ -0,0 +1,72 @@
+#!/usr/local/bin/perl -w
+
+use lib qw(t/lib);
+use strict;
+
+# Due to a bug in older versions of MakeMaker & Test::Harness, we must
+# ensure the blib's are in @INC, else we might use the core CGI.pm
+use lib qw(blib/lib blib/arch);
+use Test::More tests => 45;
+
+use CGI qw(:standard start_h1 start_h2 start_h3 start_h4 start_h5 start_h6 start_table start_ul start_li start_ol start_td start_b start_i start_u start_div);
+
+is(start_h1(), "<h1>", "start_h1"); # TEST
+is(start_h1({class => 'hello'}), "<h1 class=\"hello\">", "start_h1 with param"); # TEST
+is(end_h1(), "</h1>", "end_h1"); # TEST
+
+is(start_h2(), "<h2>", "start_h2"); # TEST
+is(start_h2({class => 'hello'}), "<h2 class=\"hello\">", "start_h2 with param"); # TEST
+is(end_h2(), "</h2>", "end_h2"); # TEST
+
+is(start_h3(), "<h3>", "start_h3"); # TEST
+is(start_h3({class => 'hello'}), "<h3 class=\"hello\">", "start_h3 with param"); # TEST
+is(end_h3(), "</h3>", "end_h3"); # TEST
+
+is(start_h4(), "<h4>", "start_h4"); # TEST
+is(start_h4({class => 'hello'}), "<h4 class=\"hello\">", "start_h4 with param"); # TEST
+is(end_h4(), "</h4>", "end_h4"); # TEST
+
+is(start_h5(), "<h5>", "start_h5"); # TEST
+is(start_h5({class => 'hello'}), "<h5 class=\"hello\">", "start_h5 with param"); # TEST
+is(end_h5(), "</h5>", "end_h5"); # TEST
+
+is(start_h6(), "<h6>", "start_h6"); # TEST
+is(start_h6({class => 'hello'}), "<h6 class=\"hello\">", "start_h6 with param"); # TEST
+is(end_h6(), "</h6>", "end_h6"); # TEST
+
+is(start_table(), "<table>", "start_table"); # TEST
+is(start_table({class => 'hello'}), "<table class=\"hello\">", "start_table with param"); # TEST
+is(end_table(), "</table>", "end_table"); # TEST
+
+is(start_ul(), "<ul>", "start_ul"); # TEST
+is(start_ul({class => 'hello'}), "<ul class=\"hello\">", "start_ul with param"); # TEST
+is(end_ul(), "</ul>", "end_ul"); # TEST
+
+is(start_li(), "<li>", "start_li"); # TEST
+is(start_li({class => 'hello'}), "<li class=\"hello\">", "start_li with param"); # TEST
+is(end_li(), "</li>", "end_li"); # TEST
+
+is(start_ol(), "<ol>", "start_ol"); # TEST
+is(start_ol({class => 'hello'}), "<ol class=\"hello\">", "start_ol with param"); # TEST
+is(end_ol(), "</ol>", "end_ol"); # TEST
+
+is(start_td(), "<td>", "start_td"); # TEST
+is(start_td({class => 'hello'}), "<td class=\"hello\">", "start_td with param"); # TEST
+is(end_td(), "</td>", "end_td"); # TEST
+
+is(start_b(), "<b>", "start_b"); # TEST
+is(start_b({class => 'hello'}), "<b class=\"hello\">", "start_b with param"); # TEST
+is(end_b(), "</b>", "end_b"); # TEST
+
+is(start_i(), "<i>", "start_i"); # TEST
+is(start_i({class => 'hello'}), "<i class=\"hello\">", "start_i with param"); # TEST
+is(end_i(), "</i>", "end_i"); # TEST
+
+is(start_u(), "<u>", "start_u"); # TEST
+is(start_u({class => 'hello'}), "<u class=\"hello\">", "start_u with param"); # TEST
+is(end_u(), "</u>", "end_u"); # TEST
+
+is(start_div(), "<div>", "start_div"); # TEST
+is(start_div({class => 'hello'}), "<div class=\"hello\">", "start_div with param"); # TEST
+is(end_div(), "</div>", "end_div"); # TEST
+