#!/usr/bin/perl
#
# Run some general tests around the generation of elements. We will
# test seperate components in more detail in other scripts.
use warnings;
use strict;
use lib 'lib','t';
use TestTools;
use XML::Compile::Schema;
use XML::Compile::Tester;
use Test::More tests => 57;
my $schema = XML::Compile::Schema->new( <<__SCHEMA__ );
__SCHEMA__
ok(defined $schema);
#
# simple element type
#
test_rw($schema, test1 => <<__XML__, 42);
42
__XML__
test_rw($schema, test1 => <<__XML__, -1);
-1
__XML__
test_rw($schema, test1 => <<__XML__, 121);
121
__XML__
#
# the simpleType, less simple type
#
test_rw($schema, test3 => <<__XML__, 78);
78
__XML__
test_rw($schema, test6 => <<__XML__, 79);
79
__XML__
#
# The not so complex complexType
#
test_rw($schema, test4 => <<__XML__, {ct_1 => 14, ct_2 => 43});
14
43
__XML__
test_rw($schema, test5 => <<__XML__, {ct_1 => 15, ct_2 => 44});
15
44
__XML__
# for test6 see above
#
# Test default: should not be set automatically
#
test_rw($schema, test7 => <<__XML__, {ct_1 => 41, ct_2 => 42}, <<__XML__, {ct_1 => 41});
41
__XML__
41
__XML__