From: Justin Hunter Date: Tue, 8 Sep 2009 19:17:53 +0000 (-0700) Subject: change from parse_mysql_version (in S::T::Utils) to engine_version (function of Trans... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=deb9f57f38f0f84ebbe4567bb48c970c79ed38c3;p=dbsrgits%2FSQL-Translator-2.0-ish.git change from parse_mysql_version (in S::T::Utils) to engine_version (function of Translator) --- diff --git a/t/02mysql-parser.t b/t/02mysql-parser.t index a058f80..13d611d 100644 --- a/t/02mysql-parser.t +++ b/t/02mysql-parser.t @@ -673,10 +673,11 @@ my $parse_as = { }, }; +my $tr = SQL::Translator->new; for my $target (keys %$parse_as) { for my $str (keys %{$parse_as->{$target}}) { cmp_ok ( - SQL::Translator::Utils::parse_mysql_version ($str, $target), + $tr->engine_version($str, $target), '==', $parse_as->{$target}{$str}, "'$str' parsed as $target version '$parse_as->{$target}{$str}'", @@ -684,11 +685,11 @@ for my $target (keys %$parse_as) { } } -eval { SQL::Translator::Utils::parse_mysql_version ('bogus5.1') }; +eval { $tr->engine_version ('bogus5.1') }; ok ($@, 'Exception thrown on invalid version string'); { - my $tr = SQL::Translator->new; + my $tr = SQL::Translator->new({ from => 'MySQL' }); my $data = q|create table merge_example ( id int(11) NOT NULL auto_increment, shape_field geometry NOT NULL,