From: Peter Rabbitson Date: Mon, 4 May 2009 12:49:16 +0000 (+0000) Subject: Adjust insane tests to pass (the expected returns at times are mind-boggling) X-Git-Tag: v0.11008~163^2~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=963fd5fc994c8ce3b8d542dc772d461775f7d8e7;p=dbsrgits%2FSQL-Translator.git Adjust insane tests to pass (the expected returns at times are mind-boggling) --- diff --git a/t/30sqlt-new-diff-pgsql.t b/t/30sqlt-new-diff-pgsql.t index 0926514..5fd1440 100644 --- a/t/30sqlt-new-diff-pgsql.t +++ b/t/30sqlt-new-diff-pgsql.t @@ -109,7 +109,7 @@ eq_or_diff($out, <<'## END OF DIFF', "Diff as expected"); BEGIN; -CREATE TABLE added02 ( +CREATE TABLE added ( id bigint ); @@ -119,9 +119,9 @@ ALTER TABLE person DROP CONSTRAINT UC_age_name; ALTER TABLE employee DROP COLUMN job_title; -ALTER TABLE new_name ADD COLUMN new_field02 integer; +ALTER TABLE new_name ADD COLUMN new_field integer; -ALTER TABLE person ADD COLUMN is_rock_star02 smallint DEFAULT '1'; +ALTER TABLE person ADD COLUMN is_rock_star smallint DEFAULT '1'; ALTER TABLE person ALTER COLUMN person_id TYPE serial; diff --git a/t/30sqlt-new-diff-sqlite.t b/t/30sqlt-new-diff-sqlite.t index 7f5ebb5..143f6a5 100644 --- a/t/30sqlt-new-diff-sqlite.t +++ b/t/30sqlt-new-diff-sqlite.t @@ -66,11 +66,11 @@ ALTER TABLE person ADD COLUMN is_rock_star tinyint(4) DEFAULT '1'; -- SQL::Translator::Producer::SQLite cant rename_field; -CREATE UNIQUE INDEX unique_name_person ON person (name); +CREATE UNIQUE INDEX unique_name ON person (name); -CREATE UNIQUE INDEX UC_person_id_person ON person (person_id); +CREATE UNIQUE INDEX UC_person_id ON person (person_id); -CREATE UNIQUE INDEX UC_age_name_person ON person (age, name); +CREATE UNIQUE INDEX UC_age_name ON person (age, name); DROP TABLE deleted; @@ -143,11 +143,11 @@ CREATE TABLE person ( physical_description text ); -CREATE UNIQUE INDEX unique_name_person02 ON person (name); +CREATE UNIQUE INDEX unique_name02 ON person (name); -CREATE UNIQUE INDEX UC_person_id_person02 ON person (person_id); +CREATE UNIQUE INDEX UC_person_id02 ON person (person_id); -CREATE UNIQUE INDEX UC_age_name_person02 ON person (age, name); +CREATE UNIQUE INDEX UC_age_name02 ON person (age, name); INSERT INTO person SELECT person_id, name, age, weight, iq, is_rock_star, physical_description FROM person_temp_alter; @@ -160,6 +160,10 @@ COMMIT; ## END OF DIFF +# Note the 02 in the 3 names above (end of diff) are an implementation +# quirk - there is nothing to reset the global seen-names register +# The rewrite should abolish this altogether, and carry the register in +# the main schema object # Test for sameness $out = SQL::Translator::Diff::schema_diff($source_schema, 'MySQL', $source_schema, 'MySQL' ); diff --git a/t/48xml-to-sqlite.t b/t/48xml-to-sqlite.t index 504d97e..2beef04 100644 --- a/t/48xml-to-sqlite.t +++ b/t/48xml-to-sqlite.t @@ -53,9 +53,9 @@ CREATE TABLE Basic ( timest timestamp ); -CREATE INDEX titleindex_Basic ON Basic (title); +CREATE INDEX titleindex ON Basic (title); -CREATE UNIQUE INDEX emailuniqueindex_Basic ON Basic (email); +CREATE UNIQUE INDEX emailuniqueindex ON Basic (email); DROP TABLE Another; @@ -105,8 +105,8 @@ eq_or_diff(\@sql, another_id int(10) DEFAULT \'2\', timest timestamp )', - 'CREATE INDEX titleindex_Basic02 ON Basic (title)', - 'CREATE UNIQUE INDEX emailuniqueindex_Basic02 ON Basic (email)', + 'CREATE INDEX titleindex ON Basic (title)', + 'CREATE UNIQUE INDEX emailuniqueindex ON Basic (email)', 'DROP TABLE Another', 'CREATE TABLE Another ( id INTEGER PRIMARY KEY NOT NULL