Skip to content

Commit b9d6c03

Browse files
authored
Merge pull request #36 from JRaspass/master
Replace "Test" with "Test::More"
2 parents 2e4fbb7 + 2249459 commit b9d6c03

8 files changed

Lines changed: 125 additions & 133 deletions

File tree

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change history for HTML-Form
44

55
- Replace "use vars" with "our" (GH#34) (James Raspass)
66
- Remove superfluous "use lib" (GH#35) (James Raspass)
7+
- Replace "Test" with "Test::More" (GH#36) (James Raspass)
78

89
6.08 2022-08-14 09:26:10Z
910
- Remove Authority section from dist.ini (GH#27) (Olaf Alders)

META.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ExtUtils::MakeMaker" : "0",
7373
"File::Spec" : "0",
7474
"HTTP::Response" : "0",
75-
"Test" : "0",
7675
"Test::More" : "0.96",
7776
"warnings" : "0"
7877
}

Makefile.PL

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ my %WriteMakefileArgs = (
3030
"ExtUtils::MakeMaker" => 0,
3131
"File::Spec" => 0,
3232
"HTTP::Response" => 0,
33-
"Test" => 0,
3433
"Test::More" => "0.96",
3534
"warnings" => 0
3635
},
@@ -50,7 +49,6 @@ my %FallbackPrereqs = (
5049
"HTTP::Request" => 6,
5150
"HTTP::Request::Common" => "6.03",
5251
"HTTP::Response" => 0,
53-
"Test" => 0,
5452
"Test::More" => "0.96",
5553
"URI" => "1.10",
5654
"strict" => 0,

cpanfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on 'test' => sub {
1515
requires "ExtUtils::MakeMaker" => "0";
1616
requires "File::Spec" => "0";
1717
requires "HTTP::Response" => "0";
18-
requires "Test" => "0";
1918
requires "Test::More" => "0.96";
2019
requires "warnings" => "0";
2120
};

t/form-label.t

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
use strict;
44
use warnings;
5-
use Test qw(plan ok);
6-
7-
plan tests => 2;
85

6+
use Test::More tests => 2;
97
use HTML::Form;
108

119
{
@@ -16,7 +14,7 @@ my $form = HTML::Form->parse(<<"EOT", base => "http://example.com", strict => 1)
1614
</label>
1715
</form>
1816
EOT
19-
ok($form->param('tt'), 'test content');
17+
is($form->param('tt'), 'test content');
2018

2119
}
2220

@@ -29,5 +27,5 @@ my $form = HTML::Form->parse(<<"EOT", base => "http://example.com", strict => 1)
2927
</form>
3028
EOT
3129

32-
ok($form->param('tt'), 'test content');
30+
is($form->param('tt'), 'test content');
3331
}

t/form-selector.t

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#!perl -w
1+
#!perl
22

33
use strict;
4-
use Test qw(plan ok);
5-
6-
plan tests => 12;
4+
use warnings;
75

6+
use Test::More tests => 12;
87
use HTML::Form;
98

109
my $form = HTML::Form->parse(<<"EOT", base => "http://example.com", strict => 1);
@@ -23,24 +22,24 @@ EOT
2322

2423
#$form->dump;
2524

26-
ok($form->value("n1"), 1);
27-
ok($form->value("^n1"), 1);
28-
ok($form->value("#id1"), 1);
29-
ok($form->value(".A"), 1);
30-
ok($form->value("#id2"), 2);
31-
ok($form->value(".B"), 3);
25+
is($form->value("n1"), 1);
26+
is($form->value("^n1"), 1);
27+
is($form->value("#id1"), 1);
28+
is($form->value(".A"), 1);
29+
is($form->value("#id2"), 2);
30+
is($form->value(".B"), 3);
3231

33-
ok(j(map $_->value, $form->find_input(".A")), "1:2");
32+
is(j(map $_->value, $form->find_input(".A")), "1:2");
3433

3534
$form->find_input("#id2")->name("n2");
3635
$form->value("#id2", 22);
37-
ok($form->click->uri->query, "n1=1&n2=22");
36+
is($form->click->uri->query, "n1=1&n2=22");
3837

3938
# try some odd names
40-
ok($form->find_input("##foo")->name, "#bar");
41-
ok($form->find_input("#bar"), undef);
42-
ok($form->find_input("^#bar")->class, ".D");
43-
ok($form->find_input("..D")->id, "#foo");
39+
is($form->find_input("##foo")->name, "#bar");
40+
is($form->find_input("#bar"), undef);
41+
is($form->find_input("^#bar")->class, ".D");
42+
is($form->find_input("..D")->id, "#foo");
4443

4544
sub j {
4645
join(":", @_);

t/form-unicode.t

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#!perl -w
1+
#!perl
22

33
use strict;
4+
use warnings;
45

5-
use Test qw(plan ok);
6-
plan tests => 15;
7-
6+
use Test::More tests => 15;
87
use HTML::Form;
98

109
my @warn;
@@ -18,32 +17,32 @@ my $f = HTML::Form->parse(<<'EOT', "http://localhost/");
1817
<form></form>
1918
EOT
2019

21-
ok($f->value("name"), "");
22-
ok($f->accept_charset, "UNKNOWN");
20+
is($f->value("name"), "");
21+
is($f->accept_charset, "UNKNOWN");
2322
my $req = $f->click;
24-
ok($req->uri, "http://localhost/abc?name=&latin=");
23+
is($req->uri, "http://localhost/abc?name=&latin=");
2524

2625
$f->value(name => "\x{0424}"); # capital cyrillic ef
2726
$f->value(latin => "\xE5"); # aring
2827
$req = $f->click;
29-
ok($req->method, "GET");
30-
ok($req->uri, "http://localhost/abc?name=%D0%A4&latin=%C3%A5");
28+
is($req->method, "GET");
29+
is($req->uri, "http://localhost/abc?name=%D0%A4&latin=%C3%A5");
3130

3231
$f->method('POST');
3332
$f->enctype('multipart/form-data');
3433

3534
$req = $f->click;
36-
ok($req->uri, "http://localhost/abc");
37-
ok($req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xD0\xA4\r\n--xYzZY\r\nContent-Disposition: form-data; name=\"latin\"\r\n\r\n\xC3\xA5\r\n--xYzZY--\r\n");
35+
is($req->uri, "http://localhost/abc");
36+
is($req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xD0\xA4\r\n--xYzZY\r\nContent-Disposition: form-data; name=\"latin\"\r\n\r\n\xC3\xA5\r\n--xYzZY--\r\n");
3837

3938
$f->accept_charset('koi8-r');
4039
$req = $f->click;
41-
ok($req->uri, "http://localhost/abc");
42-
ok($req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xE6\r\n--xYzZY\r\nContent-Disposition: form-data; name=\"latin\"\r\n\r\n?\r\n--xYzZY--\r\n");
40+
is($req->uri, "http://localhost/abc");
41+
is($req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xE6\r\n--xYzZY\r\nContent-Disposition: form-data; name=\"latin\"\r\n\r\n?\r\n--xYzZY--\r\n");
4342

4443
$f->method('GET');
4544
$req = $f->click;
46-
ok($req->uri, "http://localhost/abc?name=%E6&latin=%3F");
45+
is($req->uri, "http://localhost/abc?name=%E6&latin=%3F");
4746

4847
$f = HTML::Form->parse(<<'EOT', "http://localhost/");
4948
<form action="abc" name="foo" accept-charset="koi8-r">
@@ -52,16 +51,16 @@ $f = HTML::Form->parse(<<'EOT', "http://localhost/");
5251
<form></form>
5352
EOT
5453

55-
ok($f->accept_charset, 'koi8-r');
54+
is($f->accept_charset, 'koi8-r');
5655

5756
$f->value(name => "\x{0425}"); # capital cyrillic kha
5857
$req = $f->click;
59-
ok($req->method, "GET");
60-
ok($req->uri, "http://localhost/abc?name=%E8");
58+
is($req->method, "GET");
59+
is($req->uri, "http://localhost/abc?name=%E8");
6160

6261
$f->method('POST');
6362
$f->enctype('multipart/form-data');
6463

6564
$req = $f->click;
66-
ok($req->uri, "http://localhost/abc");
67-
ok($req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xE8\r\n--xYzZY--\r\n");
65+
is($req->uri, "http://localhost/abc");
66+
is($req->content, "--xYzZY\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\n\xE8\r\n--xYzZY--\r\n");

0 commit comments

Comments
 (0)