Skip to content

Commit 2ed36dc

Browse files
author
Chris White
committed
Added XML::Axk::L1 tests; test infrastructure
Added AxkTest::Helpers and fixed/cleaned Object::TinyDefaults test code
1 parent 49f32b5 commit 2ed36dc

File tree

13 files changed

+178
-68
lines changed

13 files changed

+178
-68
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ inc/
4343

4444
# Capture::Tiny
4545
DEBUG*
46+
47+
# Other
48+
/stuff

MANIFEST

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
bin/axk
22
Changes
3-
ex/1.axk
4-
ex/2.axk
5-
ex/ex1.xml
6-
ex/oneliner
7-
ex/xml1.axk
83
lib/Object/TinyDefaults.pm
94
lib/XML/Axk.pm
105
lib/XML/Axk/App.pm
116
lib/XML/Axk/Base.pm
127
lib/XML/Axk/Core.pm
138
lib/XML/Axk/DOM.pm
9+
lib/XML/Axk/L0.pm
1410
lib/XML/Axk/L1.pm
11+
lib/XML/Axk/Language.pm
1512
lib/XML/Axk/Matcher/Always.pm
1613
lib/XML/Axk/Matcher/XPath.pm
1714
lib/XML/Axk/Sandbox.pm
@@ -20,12 +17,25 @@ lib/XML/Axk/SAX/Handler.pm
2017
lib/XML/Axk/SAX/Runner.pm
2118
lib/XML/Axk/Vars/Array.pm
2219
lib/XML/Axk/Vars/Scalar.pm
20+
LICENSE
2321
Makefile.PL
2422
MANIFEST This list of files
25-
LICENSE
23+
MANIFEST.SKIP
2624
README.md
2725
t/00-load.t
28-
xt/boilerplate.t
29-
xt/manifest.t
30-
xt/pod-coverage.t
31-
xt/pod.t
26+
t/02-basic-app.t
27+
t/02-basic-core.t
28+
t/04-languages.t
29+
t/06-class-tests.t
30+
t/ex/02-noL.axk
31+
t/ex/02.axk
32+
t/ex/1.axk
33+
t/ex/2.axk
34+
t/ex/ex1.xml
35+
t/ex/l0.axk
36+
t/ex/oneliner
37+
t/ex/xml1.axk
38+
t/lib/AxkTest.pm
39+
t/lib/AxkTest/Helpers.pm
40+
t/tests/T/Object/TinyDefaults.pm
41+
t/tests/T/XML/Axk/L1.pm

MANIFEST.SKIP

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# MANIFEST.SKIP for Text::PerlPP
2+
3+
# Avoid version control files.
4+
\bRCS\b
5+
\bCVS\b
6+
\bSCCS\b
7+
,v$
8+
\B\.svn\b
9+
\B\.git\b
10+
\B\.gitignore\b
11+
\b_darcs\b
12+
\B\.cvsignore$
13+
14+
# Avoid VMS specific MakeMaker generated files
15+
\bDescrip.MMS$
16+
\bDESCRIP.MMS$
17+
\bdescrip.mms$
18+
19+
# Avoid Makemaker generated and utility files.
20+
\bMANIFEST\.bak
21+
\bMakefile$
22+
\bblib/
23+
\bMakeMaker-\d
24+
\bpm_to_blib\.ts$
25+
\bpm_to_blib$
26+
\bblibdirs\.ts$ # 6.18 through 6.25 generated this
27+
\b_eumm/ # 7.05_05 and above
28+
29+
# Avoid Module::Build generated and utility files.
30+
\bBuild$
31+
\b_build/
32+
\bBuild.bat$
33+
\bBuild.COM$
34+
\bBUILD.COM$
35+
\bbuild.com$
36+
37+
# and Module::Build::Tiny generated files
38+
\b_build_params$
39+
40+
# Avoid temp and backup files.
41+
~$
42+
\.old$
43+
\#$
44+
\b\.#
45+
\.bak$
46+
\.tmp$
47+
\.#
48+
\.rej$
49+
\..*\.sw.?$
50+
51+
# Avoid OS-specific files/dirs
52+
# Mac OSX metadata
53+
\B\.DS_Store
54+
# Mac OSX SMB mount metadata files
55+
\B\._
56+
57+
# Avoid Devel::Cover and Devel::CoverX::Covered files.
58+
\bcover_db\b
59+
\bcovered\b
60+
61+
# Avoid prove files
62+
\B\.prove$
63+
64+
# Avoid MYMETA files
65+
^MYMETA\.
66+
67+
/MANIFEST.SKIP
68+
69+
# Skip directories
70+
^stuff\b
71+
72+
# Skip some specific files
73+
^tags
74+
\.stackdump$
75+
^run$
76+
^xt\/
77+
\bDEBUG

bin/axk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
#!/usr/bin/perl -w
2+
# Copyright (c) 2018 cxw42. All rights reserved. Artistic 2.
23
# To run this manually from the source tree, do
34
# perl -Ilib bin/axk
4-
55
use XML::Axk::App;
6-
76
exit(XML::Axk::App::Main(\@ARGV));
8-
9-
107
# vi: set ts=4 sts=4 sw=4 et ai ft=perl: #

lib/XML/Axk/L1.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ our @EXPORT = qw(
2828
always never xpath sel on run entering leaving whenever);
2929
our @EXPORT_OK = qw( @SP_names );
3030

31+
# Config
32+
our $C_WANT_TEXT = 0;
33+
3134
# Helpers ======================================================== {{{1
3235

3336
# Accessor

t/02-basic-app.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ sub localpath {
3030
{
3131
my $out =
3232
capture_stdout
33-
{ XML::Axk::App::Main([ '-f', localpath('02.axk'), '--no-input']) };
33+
{ XML::Axk::App::Main([ '-f', localpath('ex/02.axk'), '--no-input']) };
3434
is($out, '1337', 'on-disk script runs');
3535
}
3636

3737
# }}}1
3838
# Script with no language indicator =============================== {{{1
3939
{
40-
eval { XML::Axk::App::Main([ '-f', localpath('02-noL.axk'),
40+
eval { XML::Axk::App::Main([ '-f', localpath('ex/02-noL.axk'),
4141
'--no-input']) };
4242
my $err = $@;
4343
like($err, qr/No language \(Ln\) specified/, 'detects missing Ln');

t/02-basic-core.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ sub localpath {
4444
# Script on disk ================================================== {{{1
4545
{
4646
my $core = XML::Axk::Core->new();
47-
$core->load_script_file(localpath '02.axk');
47+
$core->load_script_file(localpath 'ex/02.axk');
4848

4949
my $out = capture_stdout { $core->run(); };
5050
is($out, '1337', 'on-disk script runs');
@@ -54,7 +54,7 @@ sub localpath {
5454
# Script with no language indicator =============================== {{{1
5555
{
5656
my $core = XML::Axk::Core->new();
57-
eval { $core->load_script_file(localpath '02-noL.axk'); };
57+
eval { $core->load_script_file(localpath 'ex/02-noL.axk'); };
5858
my $err = $@;
5959
like($err, qr/No language \(Ln\) specified/, 'detects missing Ln');
6060
}
File renamed without changes.
File renamed without changes.

t/lib/AxkTest.pm

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
#!perl
2-
# AxkTest.pm: Test::Kit for XML::Axk
3-
4-
use Test::Kit;
5-
use 5.018;
6-
use strict;
7-
use warnings;
8-
9-
include feature => {
10-
import => [':5.18']
11-
};
12-
include qw(strict warnings);
13-
include qw(Test::More File::Spec XML::Axk::App);
14-
include 'Capture::Tiny' => {
15-
import => [qw(capture_stdout capture_merged)]
16-
};
17-
18-
1;
19-
20-
# vi: set ts=4 sts=4 sw=4 et ai fdm=marker fdl=1: #
1+
# AxkTest.pm: Test::Kit for XML::Axk
2+
# Copyright (c) 2018 cxw42. All rights reserved. Artistic 2.
3+
package AxkTest;
4+
5+
use Test::Kit;
6+
use 5.018;
7+
use strict;
8+
use warnings;
9+
10+
include feature => {
11+
import => [':5.18']
12+
};
13+
include qw(strict warnings);
14+
include qw(Test::More File::Spec XML::Axk::App XML::Axk::Core);
15+
include qw(AxkTest::Helpers);
16+
include 'Capture::Tiny' => {
17+
import => [qw(capture_stdout capture_merged)]
18+
};
19+
20+
1;
21+
22+
# vi: set ts=4 sts=4 sw=4 et ai fdm=marker fdl=1: #

0 commit comments

Comments
 (0)