File: 02-empty.t

package info (click to toggle)
eperl 2.2.14-21
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,304 kB
  • ctags: 738
  • sloc: ansic: 4,694; perl: 584; sh: 556; makefile: 353
file content (37 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (12)
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

require "TEST.pl";
&TEST::init;

print "1..2\n";

#
#   TEST 1: total empty file
#
$tmpfile1 = &TEST::tmpfile("");
$tmpfile2 = &TEST::tmpfile;
&TEST::system("../eperl $tmpfile1 >$tmpfile2");
$rc = &TEST::system("cmp $tmpfile1 $tmpfile2");
print ($rc == 0 ? "ok\n" : "not ok\n");

#
#   TEST 2: file with empty Perl 5 block
#
$tmpfile1 = &TEST::tmpfile(<<'EOT'
foo bar baz quux
foo<::>bar<?!>baz<:   :>quux
foo bar baz quux
EOT
);
$tmpfile2 = &TEST::tmpfile;
$tmpfile3 = &TEST::tmpfile(<<'EOT'
foo bar baz quux
foobar<?!>bazquux
foo bar baz quux
EOT
);
&TEST::system("../eperl -B '<:' -E ':>' $tmpfile1 >$tmpfile2");
$rc = &TEST::system("cmp $tmpfile2 $tmpfile3");
print ($rc == 0 ? "ok\n" : "not ok\n");

&TEST::cleanup;