From: Peter Rabbitson Date: Sat, 3 Oct 2009 17:57:32 +0000 (+0000) Subject: Add a size/precision field to test file, make sure xml parser/producer work fine X-Git-Tag: v0.11008~80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a0aab7b528f29da185d00a63b4f11597fdd6170;p=dbsrgits%2FSQL-Translator.git Add a size/precision field to test file, make sure xml parser/producer work fine --- diff --git a/t/16xml-parser.t b/t/16xml-parser.t index 53180eb..ae96dd4 100644 --- a/t/16xml-parser.t +++ b/t/16xml-parser.t @@ -27,7 +27,7 @@ use constant DEBUG => (exists $opt{d} ? 1 : 0); #============================================================================= BEGIN { - maybe_plan(212, 'SQL::Translator::Parser::XML::SQLFairy'); + maybe_plan(224, 'SQL::Translator::Parser::XML::SQLFairy'); } my $testschema = "$Bin/data/xml/schema.xml"; @@ -199,6 +199,12 @@ schema_ok( $scma, { is_primary_key => 1, is_auto_increment => 1, }, + { + name => "num", + data_type => "numeric", + default_value => undef, + size => '10,2', + }, ], }, # end table Another ], # end tables diff --git a/t/17sqlfxml-producer.t b/t/17sqlfxml-producer.t index 050bc42..5b9fa76 100644 --- a/t/17sqlfxml-producer.t +++ b/t/17sqlfxml-producer.t @@ -297,6 +297,14 @@ $ans = < + + + + + + + + @@ -326,6 +334,18 @@ EOXML ) or die $t->error; $f->extra(ZEROFILL => "1"); + $t->add_field( + name => "bar", + data_type => "numeric", + size => "10,2", + ) or die $t->error; + $t->add_field( + name => "baz", + data_type => "decimal", + size => [8,3], + ) or die $t->error; + + # As we have created a Schema we give translate a dummy string so that # it will run the produce. lives_ok {$xml =$obj->translate("FOO");} "Translate (Field.extra) ran"; diff --git a/t/data/roundtrip.xml b/t/data/roundtrip.xml index db07e42..8630ee0 100644 --- a/t/data/roundtrip.xml +++ b/t/data/roundtrip.xml @@ -39,6 +39,12 @@ Created on Fri Aug 15 15:08:18 2003 + + + + diff --git a/t/data/xml/schema.xml b/t/data/xml/schema.xml index 9949637..685ceff 100644 --- a/t/data/xml/schema.xml +++ b/t/data/xml/schema.xml @@ -71,6 +71,11 @@ Created on Fri Aug 15 15:08:18 2003 size="10" data_type="int" is_auto_increment="1" order="1" is_nullable="0"> + +