File: basic.t

package info (click to toggle)
libclass-methodmaker-perl 2.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 524 kB
  • sloc: perl: 1,849; objc: 492; makefile: 3
file content (59 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download | duplicates (7)
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
# (X)Emacs mode: -*- cperl -*-

use strict;

=head1 Unit Test Package for Class::MethodMaker

This package tests the basic compilation and working of Class::MethodMaker

=cut

use Data::Dumper        qw( );
use FindBin        1.42 qw( $Bin );
use Test           1.13 qw( ok plan );

use lib $Bin;
use test qw( DATA_DIR
             evcheck );

BEGIN {
  # 1 for compilation test,
  plan tests  => 2,
       todo   => [],
}

# ----------------------------------------------------------------------------

=head2 Test 1: compilation

This test confirms that the test script and the modules it calls compiled
successfully.

=cut

use Class::MethodMaker;

ok 1, 1, 'compilation';

# -------------------------------------

=head2 Test 2: scalar

=cut

package bob;

use Class::MethodMaker
  [ scalar =>[qw/ foo /] ];

package main;

my $bob = bless {}, 'bob';
print Data::Dumper->Dump([ $bob ], [qw( bob )])
  if $ENV{TEST_DEBUG};
$bob->foo("x");
print Data::Dumper->Dump([ $bob ], [qw( bob )])
  if $ENV{TEST_DEBUG};
ok $bob->foo, "x",                                              'scalar ( 1)';

# ----------------------------------------------------------------------------