File: compile.t

package info (click to toggle)
libtest-class-perl 0.35-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 476 kB
  • ctags: 102
  • sloc: perl: 1,668; makefile: 2
file content (29 lines) | stat: -rwxr-xr-x 514 bytes parent folder | download | duplicates (4)
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
#! /usr/bin/perl -T

use strict;
use warnings;
use IO::File;
use Fcntl;

use base qw(Test::Class);
use Test::More tests => 2;

my $stderr;

BEGIN {
	$stderr = IO::File->new_tmpfile or die "no tmp file ($!)\n";
	*STDERR = $stderr;
};


my $sub = sub : Test(1) {print "ok\n"};
sub foo : Test(foo) {print "ok\n"};


END {
	seek $stderr, SEEK_SET, 0;
	like(<$stderr>, qr/cannot test anonymous subs/, 
			"cannot test anon sub");
	is(<$stderr>, "bad test definition 'foo' in main->foo\n",
			"bad number detected");
};