Skip to content

Commit fea7fa6

Browse files
authored
Merge pull request #11 from ikedas/basic-tests by ikedas
Adding basic tests and so on
2 parents 6fcb76d + 32c7c4e commit fea7fa6

7 files changed

+119
-6
lines changed

.gitlab-ci.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
- perl -v
77
script:
88
- cpanm --installdeps --notest .
9+
- cpanm --notest Test::Compile::Internal
10+
- cpanm --notest CGI
911
- cpanm --notest Unicode::String Unicode::MapUTF8
10-
- for i in lib/*.pl lib/MHonArc/*.pm lib/MHonArc/*/*.pm; do perl -Ilib -c $i; done
1112
- perl Makefile.PL
1213
- make
13-
- make install
14-
- make tardist
14+
- make disttest
15+
- make dist
1516
- cpanm -L local MHonArc-*.tar.gz
1617
- make clean
1718

@@ -37,3 +38,5 @@
3738
<<: *job
3839
"5.30":
3940
<<: *job
41+
"5.32":
42+
<<: *job

.travis.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: perl
22

33
perl:
4+
- "5.32"
45
- "5.30"
56
- "5.28"
67
- "5.26"
@@ -21,11 +22,12 @@ before_script:
2122

2223
script:
2324
- cpanm --installdeps --notest .
25+
- cpanm --notest Test::Compile::Internal
26+
- cpanm --notest CGI
2427
- cpanm --notest Unicode::String Unicode::MapUTF8
25-
- for i in lib/*.pl lib/MHonArc/*.pm lib/MHonArc/*/*.pm; do perl -Ilib -c $i || exit 1; done
2628
- perl Makefile.PL
2729
- make
28-
- make install
29-
- make tardist
30+
- make disttest
31+
- make dist
3032
- cpanm -L local MHonArc-*.tar.gz
3133
- make clean

MANIFEST

+4
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,14 @@ man/mha-dbrecover.1
532532
man/mha-decode.1
533533
man/mhonarc.1
534534
MANIFEST This list of files
535+
MANIFEST.SKIP
535536
mha-dbedit
536537
mha-dbrecover
537538
mha-decode
538539
mhonarc
539540
README.txt
540541
RELNOTES
542+
t/compile.t
543+
t/readmail-MAILhead_get_disposition.t
541544
TODO
545+
xt/perltidy.t

MANIFEST.SKIP

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ExtUtils::MakeMaker
2+
^MANIFEST[.]bak
3+
^Makefile$
4+
^Makefile[.]old$
5+
^blib/
6+
^MakeMaker-\d
7+
^pm_to_blib$
8+
^pm_to_blib[.]ts$
9+
^MHonArc-[.\d_]+[.]tar[.]gz$
10+
11+
# MYMETA.* files
12+
^MYMETA[.]
13+
14+
# PerlTidy
15+
^[.]perltidyrc$
16+
^[.]tidyall[.]d/
17+
18+
# Git
19+
\B[.]git\b
20+
\B[.]gitignore\b
21+
22+
# GitHub
23+
^[.]travis[.]yml$
24+
^[.]github/
25+
26+
# Gitlab
27+
^[.]gitlab-ci[.]yml$
28+
29+
# Temporary/backup files
30+
^#
31+
^~
32+
~$
33+
[.]bak$
34+
[.]old$
35+
[.]rej$
36+
[.]swp$
37+
[.]tmp$
38+

Makefile.PL

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ WriteMakefile(
3232
}
3333
},
3434
prereqs => {
35+
build => {
36+
requires => {
37+
'Test::Compile::Internal' => 0,
38+
},
39+
},
3540
runtime => {
3641
recommends => {
3742
'Digest::MD5' => 0,

t/compile.t

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- indent-tabs-mode: nil; -*-
2+
# vim:ft=perl:et:sw=4
3+
4+
use strict;
5+
use warnings;
6+
use Test::More;
7+
8+
BEGIN {
9+
eval 'use Test::Compile::Internal';
10+
$Test::Compile::Internal::VERSION or plan skip_all => 'Test::Compile::Internal required';
11+
}
12+
13+
my $test = Test::Compile::Internal->new;
14+
grep { ok $test->pl_file_compiles($_), "$_ compiles" }
15+
qw{mha-dbedit mha-dbrecover mha-decode mhonarc},
16+
qw{admin/mhaadmin.cgi extras/mha-mhedit/mha-mhedit};
17+
$test->all_files_ok(qw{contrib examples lib});
18+
19+
done_testing();
20+

t/readmail-MAILhead_get_disposition.t

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- indent-tabs-mode: nil; -*-
2+
# vim:ft=perl:et:sw=4
3+
4+
use strict;
5+
use warnings;
6+
use English qw(no_match_vars);
7+
use Test::More;
8+
9+
require 'mhopt.pl';
10+
require 'readmail.pl';
11+
12+
mhonarc::mhinit_readmail_vars();
13+
14+
my @tests = map { [split /\n[.]\n/, $_] } split /\n[.][.]\n*/,
15+
do { local $RS; <DATA> };
16+
17+
foreach my $test (@tests) {
18+
my ($name, $mesg, $result) = @$test;
19+
my ($fields, $header_txt) = readmail::MAILread_header(\$mesg);
20+
my ($disp, $file, $raw, $html_name) =
21+
readmail::MAILhead_get_disposition($fields);
22+
23+
is $file, $result, $name;
24+
}
25+
26+
done_testing();
27+
28+
__END__
29+
Savannah#511: Non-ASCII encoded data is not decoded in filename disposition
30+
.
31+
Content-type: application/pdf;
32+
name="=?iso-8859-1?Q?CT-564.pdf?="
33+
Content-Disposition: attachment; filename="=?iso-8859-1?Q?CT-564.pdf?="
34+
Content-transfer-encoding: base64
35+
36+
XXX
37+
38+
.
39+
CT-564.pdf
40+
..
41+

0 commit comments

Comments
 (0)