X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/e39bb2aede28e97bc9d8a0477066223388ea324f..f066b3f08d4c03198c25b243206227e5801b6935:/t/examples.t diff --git a/t/examples.t b/t/examples.t index 1af87e5..874b94a 100755 --- a/t/examples.t +++ b/t/examples.t @@ -13,7 +13,7 @@ use Test::More; my %CMDARGS = ( ping => '-c 1', curl => '-sS', - 'cat \Klog/' => '/var/log/apache2/', + 'cat \Khttpd/' => '/var/log/apache2/', ); my $filename = 'barcat'; @@ -22,9 +22,10 @@ open my $input, '<', $filename local $/ = "\n\n"; while (readline $input) { - # find code snippets in the appropriate section + # find scriptlets in the appropriate section /^=head1 EXAMPLES/ ... /^=head1/ or next; - /^\h/ or next; + /^\h/ or next; # indented code snippet + /\A\h*>/ and next; # psql prompt chomp; # compose an identifier from significant parts @@ -33,6 +34,7 @@ while (readline $input) { s/\\\n\s*//g; # line continuations s/^[(\h]+//; # subshell s/^echo\ .*?\|\s*//; # preceding input + s/'(\S+)[^']*'/$1/g; # quoted arguments s/\|.*//; # subsequent pipes s/^cat\ //; # local file s/^curl\ // and do { # remote url