File: 05seek.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 (65 lines) | stat: -rwxr-xr-x 920 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use lib qw(./blib/lib ../blib/lib);
use strict;
use Test;

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

use Inline::Files;

#1
ok(<IFILE> =~ /This is line 1/);
#2
ok(not seek IFILE, -10, 0);
#3
ok(seek IFILE, -10, 1);
#4
ok(<IFILE> =~ /line 1/);
#5
ok(seek IFILE, 20, 1);
#6
ok(<IFILE> =~ /line 3/);
#7
ok(seek IFILE, 500, 0);
#8
ok(not seek IFILE, -500, 1);
#9
ok(seek IFILE, -30, 1);
#10
ok(<IFILE> =~ /line 4/);
#11
ok(not seek IFILE, -500, 2);
#12
ok(seek IFILE, -30, 2);
#13
ok(<IFILE> =~ /line 4/);
#14
ok(seek IFILE, -30, 1);
#15
ok(<IFILE> =~ /line 3/);
#16
ok(seek IFILE, 0, 0);
#17
ok(<IFILE> =~ /line 1/);
#18
ok(seek IFILE, 16, 1);
#19
ok(<IFILE> =~ /line 3/);
#20
eval "seek IFILE, 16, 1, 0";
ok($@ =~ /Too many arguments for/);
#21
eval "seek IFILE, 16";
ok($@ =~ /Not enough arguments for/);


__IFILE__
This is line 1
This is line 2
This is line 3
This is line 4
This is line 5