File: 08-argument-parser.t

package info (click to toggle)
libfilter-signatures-perl 0.19-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: perl: 1,321; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!perl -w
use strict;
use Test::More tests => 1;
use Data::Dumper;

require Filter::signatures;
# Mimic parts of the setup of Filter::Simple
my $extractor =
$Filter::Simple::placeholder = $Filter::Simple::placeholder
    = qr/\Q$;\E(.{4})\Q$;\E/s;

# Check that we are immune against Filter::Simple embedding a comma in its
# placeholders for strings:

my $placeholder = qq(\$value = $;   ,$;);
my $stuff = Filter::signatures::parse_argument_list("foo","\$name, $placeholder");
is $stuff, 'sub foo { my ($name,$value)=@_;' . $placeholder . ' if @_ <= 1;();',
    "Filter::Simple string substitution doesn't throw us off";