From: Mark Addison Date: Thu, 7 Aug 2003 15:03:31 +0000 (+0000) Subject: Changed term single tags to empty tags to mean like tags, it being the correct... X-Git-Tag: v0.04~351 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5952d39cc86d9478817d2716804f7fed41327a18;p=dbsrgits%2FSQL-Translator.git Changed term single tags to empty tags to mean like tags, it being the correct term :) --- diff --git a/lib/SQL/Translator/Parser/SqlfXML.pm b/lib/SQL/Translator/Parser/SqlfXML.pm index cb4fc48..e1d3637 100644 --- a/lib/SQL/Translator/Parser/SqlfXML.pm +++ b/lib/SQL/Translator/Parser/SqlfXML.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::SqlfXML; # ------------------------------------------------------------------- -# $Id: SqlfXML.pm,v 1.3 2003-08-07 14:49:24 grommit Exp $ +# $Id: SqlfXML.pm,v 1.4 2003-08-07 15:03:30 grommit Exp $ # ------------------------------------------------------------------- # Copyright (C) 2003 Mark Addison , # @@ -59,7 +59,7 @@ tags or EMPTY_STRING for a zero lenth string. NULL for an explicit null EMPTY_STRING NULL - + =cut @@ -67,7 +67,7 @@ use strict; use warnings; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.4 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -180,17 +180,18 @@ __END__ =head1 BUGS -B e.g. Will be parsed as "" and hence also +B e.g. Will be parsed as "" and hence also false. This is a bit counter intuative for some tags as seeing you might think that it was set when it fact it wouldn't be. So for now it is safest not to use them until their handling by the parser -is sorted out. +is defined. =head1 TODO * Support sqf:options. * Test forign keys are parsed ok. - * Sort out sane handling of vs vs it not being there. + * Sort out sane handling of empty tags vs tags with no content + vs it no tag being there. * Control over defaulting of non-existant tags. =head1 AUTHOR diff --git a/t/16xml-parser.t b/t/16xml-parser.t index eee29df..cf861f9 100644 --- a/t/16xml-parser.t +++ b/t/16xml-parser.t @@ -100,7 +100,7 @@ is_deeply( \@tblnames, [qw/Basic/], "tables"); my $tbl = $scma->get_table("Basic"); is $tbl->order, 1, "Basic->order"; is_deeply( [map {$_->name} $tbl->get_fields], [qw/ - id title description email explicitnulldef explicitemptystring singletagdef + id title description email explicitnulldef explicitemptystring emptytagdef /] , "Table Basic's fields"); test_field($tbl->get_field("id"),{ name => "id", @@ -150,8 +150,8 @@ test_field($tbl->get_field("explicitemptystring"),{ default_value => "", is_nullable => 1, }); -test_field($tbl->get_field("singletagdef"),{ - name => "singletagdef", +test_field($tbl->get_field("emptytagdef"),{ + name => "emptytagdef", order => 7, data_type => "varchar", default_value => "", diff --git a/t/18ttschema-producer.t b/t/18ttschema-producer.t index 4f5f9d3..5a927ed 100644 --- a/t/18ttschema-producer.t +++ b/t/18ttschema-producer.t @@ -153,7 +153,7 @@ Fields extra: table: Basic - singletagdef + emptytagdef data_type: varchar size: 0 is_nullable: 1 diff --git a/t/data/xml/schema-basic.xml b/t/data/xml/schema-basic.xml index 21bfe73..2664312 100644 --- a/t/data/xml/schema-basic.xml +++ b/t/data/xml/schema-basic.xml @@ -56,7 +56,7 @@ Created on Fri Aug 1 11:24:58 2003 6 - singletagdef + emptytagdef varchar 1