File: map.t

package info (click to toggle)
libperl-prereqscanner-notquitelite-perl 0.9917-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 944 kB
  • sloc: perl: 5,239; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 984 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../";
use t::scan::Util;

test(<<'TEST'); # AUTRIJUS/Lingua-ZH-Summarize-0.01/Summarize.pm
my %punct = map { $_ => $_ } qw(¡C ¡H ¡I ¡F ...);
TEST

test(<<'TEST'); # OVID/Data-Record-0.02/lib/Data/Record.pm
sub _fields {
    my $self = shift;
    return $self->{fields} unless @_;

    my $fields = ref($self)->new(shift);
    if ( defined( my $token = $self->token ) ) {
        $fields->token($token);
    }
    $self->{fields} = $fields;
    return $self;
}

my @tokens = map { $_ x 6 } qw( ~ ` ? " { } ! @ $ % ^ & * - _ + = );
TEST

test(<<'TEST'); # MSULLIVA/String-EscapeCage-0.02/lib/String/EscapeCage.pm
  cstring => do {  # or maybe use String::Escape
	my %ESCAPE_OF = map { eval qq| "\\$_" | => "\\$_" }
	  qw( 0 a b t n f r \ " );
	my $RE = eval 'qr/[' . join( '', keys(%ESCAPE_OF) ) . ']/';
	sub {
		my $string = shift;
		$string =~ s/$RE/$ESCAPE_OF{$&}/xg;
		return $string;
	}
  },
TEST

done_testing;