File: 050astma.t

package info (click to toggle)
libtm-perl 1.53-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,780 kB
  • ctags: 594
  • sloc: perl: 34,611; sh: 377; makefile: 50
file content (53 lines) | stat: -rw-r--r-- 1,179 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use strict;
use warnings;

# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More qw(no_plan);

use Data::Dumper;
$Data::Dumper::Indent = 1;

sub _chomp {
    my $s = shift;
    chomp $s;
    return $s;
}

#== TESTS ===========================================================================

require_ok( 'TM::Materialized::AsTMa' );

{
  my $tm = new TM::Materialized::AsTMa (inline => '# this is AsTMa
');
#warn Dumper $tm;
  ok ($tm->isa('TM'),                        'correct class');
  ok ($tm->isa('TM::Materialized::Stream'),  'correct class');
  ok ($tm->isa('TM::Materialized::AsTMa'),   'correct class');
}

eval {
  my $tm = new TM::Materialized::AsTMa (url => 'file:xxx');
  $tm->sync_in;
}; like ($@, qr/unable to load/, _chomp ($@));

{ # basic operation
  my $tm = new TM::Materialized::AsTMa (inline => '# this is AsTMa
aaa (bbb)
');

  $tm->sync_in;
  ok ($tm->is_a ('tm://nirvana/aaa', 'tm://nirvana/bbb'), 'AsTMa 1: sync in');
}

{ # basic operation (2.x)
  my $tm = new TM::Materialized::AsTMa (inline => '%version 2.1

aaa isa bbb
');

  $tm->sync_in;
  ok ($tm->is_a ('tm://nirvana/aaa', 'tm://nirvana/bbb'), 'AsTMa 2: sync in');
}

__END__