#!/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;
set_compile_defaults
elements_qualified => 'NONE';
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