Skip to content

Commit f2c43d0

Browse files
author
Chris White
committed
Added test [minor]
1 parent f42eaf0 commit f2c43d0

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/XML/Axk/Core.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ files.
100100
if($add_Ln) {
101101
$leader = "use XML::Axk::L1;\n"; # To be updated over time
102102
} else {
103-
croak "No version (Ln) specified in file $fn";
103+
croak "No language (Ln) specified in file $fn";
104104
}
105105
}
106106

t/02-basic-app.t

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!perl
22

3-
package main;
4-
53
use 5.018;
64
use strict;
75
use warnings;
@@ -21,21 +19,30 @@ sub localpath {
2119
}
2220

2321
# Inline script =================================================== {{{1
24-
package main {
22+
{
2523
my $out = capture_stdout
2624
{ XML::Axk::App::Main(['-e','print 42', '--no-input']) };
2725
is($out, '42', 'inline script runs');
2826
}
2927

3028
# }}}1
3129
# Script on disk ================================================== {{{1
32-
package main {
30+
{
3331
my $out =
3432
capture_stdout
3533
{ XML::Axk::App::Main([ '-f', localpath('02.axk'), '--no-input']) };
3634
is($out, '1337', 'on-disk script runs');
3735
}
3836

37+
# }}}1
38+
# Script with no language indicator =============================== {{{1
39+
{
40+
eval { XML::Axk::App::Main([ '-f', localpath('02-noL.axk'),
41+
'--no-input']) };
42+
my $err = $@;
43+
like($err, qr/No language \(Ln\) specified/, 'detects missing Ln');
44+
}
45+
3946
# }}}1
4047

4148
done_testing();

0 commit comments

Comments
 (0)