File: lineno.t

package info (click to toggle)
libkeyword-simple-perl 0.04-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 116 kB
  • sloc: perl: 128; makefile: 2
file content (40 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (2)
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
#!perl
use strict;
use warnings FATAL => 'all';

use Test::More tests => 6;

BEGIN {
    package Some::Module;
    use Keyword::Simple;
    sub import {
        Keyword::Simple::define 'provided', sub {
            my ($ref) = @_;
            substr($$ref, 0, 0) = 'if';
        };
    }
    sub unimport {
        Keyword::Simple::undefine 'provided';
    }
    $INC{'Some/Module.pm'} = __FILE__;
};

use Some::Module;

provided (1) {
    is(__LINE__, 25);
}

#line 1
provided(1){is __LINE__, 1;}
is __LINE__, 2;

provided
#line 1
(1) { is __LINE__, 1; }
is __LINE__, 2;

provided (2) { provided (3) {
        is __LINE__, 5;
    }
}