File: 02useit.t

package info (click to toggle)
libv-perl 0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 556; makefile: 2
file content (39 lines) | stat: -rwxr-xr-x 793 bytes parent folder | download
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
#!/usr/bin/perl -I.

use strict;
use warnings;

use t::Test::abeltje;

$| = 1;

package Catch;
sub TIEHANDLE { bless \(my $self), shift }
sub PRINT     { my $self = shift; $$self .= $_[0] }

sub PRINTF {
    my $self   = shift;
    my $format = shift;
    $$self .= sprintf $format, @_;
    } # PRINTF

package main;

require_ok ("V");

local *CATCHOUT;
my $out    = tie *CATCHOUT, "Catch";
my $stdout = select CATCHOUT;

$V::NO_EXIT = 1;
V->import ("V");
select $stdout;

ok   ($$out, "V->import() produced output");
like ($$out, qr/^V\n/,                         "Module is V");
like ($$out, qr/^\t(.+?)V\.pm: $V::VERSION$/m, "VERSION is $V::VERSION");
is   ($V::NO_EXIT, 1, "Packagevar \$V::NO_EXIT set");

is (V::get_version ("V"), $V::VERSION, "get_version()");

abeltje_done_testing ();