File: 07hash.t

package info (click to toggle)
libinline-files-perl 0.71-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 232 kB
  • sloc: perl: 617; xml: 12; makefile: 7
file content (35 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (6)
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
use lib qw(./blib/lib ../blib/lib);
use strict;
use Test::More;

BEGIN {
    plan(tests => 12,
	 todo => [],
	 onfail => sub {},
	);
}

use Inline::Files;
use vars '%MYFILE';

{
    local $/;
    ok(!defined $MYFILE{file});
    ok(!defined $MYFILE{line});
    ok(!defined $MYFILE{offset});
    ok($MYFILE{writable});
    ok(!defined $MYFILE{other});
    open MYFILE;
    like($MYFILE{file} => qr/07hash.t$/);
    is($MYFILE{line} => 34);
    is($MYFILE{offset} => 654);
    ok($MYFILE{writable});
    ok(!eval{ $MYFILE{writable}=0; 1 });
    ok(!defined $MYFILE{other});
    my $text = <MYFILE>;
    close MYFILE;
    like($text => qr/Old stuff\n$/);
}

__MYFILE__
Old stuff