File: new_types.t

package info (click to toggle)
libtangram-perl 2.10-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,184 kB
  • ctags: 702
  • sloc: perl: 9,665; makefile: 9
file content (40 lines) | stat: -rw-r--r-- 1,038 bytes parent folder | download | duplicates (6)
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
#!/usr/bin/perl -w

# For bug: http://hottub.perlfect.com/pipermail/tangram-t2-maintainers/2003-November/000108.html

use lib "t";
use TestNeeds qw(Set::Object);

require "t/Capture.pm";
require "t/misc/RefImage.pm";
use strict;
use Test::More tests => 1;

use Tangram qw(:compat_quiet);
use Tangram::Relational;
use Tangram::Schema;

my $schema = Tangram::Schema->new(
    classes => {
        'Document' => {
            id => 1,
            fields => { ref_image =>
			{ image => { to => [ 'Image' ] } }
                      },
            bases => [ 'Base' ],
            table => 'Document',
                           },
        'Base'     => {
            id       => 2,
            fields   => { },
            abstract => 1,
            table    => 'Base',
                           },
              }
);

my $output = new Capture();
$output->capture_print();
eval { Tangram::Relational->deploy($schema); };
is( $@, "", "schema with new type inheriting from Tangram::Ref doesn't die" );
my $result = $output->release_stdout();