diff --git a/src/test/java/com/google/cloud/solutions/spannerddl/parser/DDLParserTest.java b/src/test/java/com/google/cloud/solutions/spannerddl/parser/DDLParserTest.java index ed1d972..a249ab2 100644 --- a/src/test/java/com/google/cloud/solutions/spannerddl/parser/DDLParserTest.java +++ b/src/test/java/com/google/cloud/solutions/spannerddl/parser/DDLParserTest.java @@ -73,8 +73,8 @@ public void parseCreateTable() throws ParseException { + " test.other_table ( other_col1, other_col2 ) ON DELETE CASCADE, \n" + " CONSTRAINT fk_col_remote2 FOREIGN KEY ( col1 ) REFERENCES test.other_table\n" + " ( other_col1 ) ON DELETE NO ACTION, \n" - + " CONSTRAINT check_some_value CHECK (( length ( sizedstring ) > 100 OR \n" - + " sizedstring = \"xxx\" ) AND boolcol = TRUE AND intcol > -123.4 AND \n" + + " CONSTRAINT check_some_value CHECK (( length ( sizedstring ) > 100 or \n" + + " sizedstring = \"xxx\" ) AND boolcol = true and intcol > -123.4 and \n" + " numericcol < 1.5)\n" + ")\n" + "PRIMARY KEY (intcol ASC, floatcol DESC, boolcol ASC), \n" diff --git a/src/test/resources/expectedDdlDiff.txt b/src/test/resources/expectedDdlDiff.txt index ec6be35..26af2f7 100644 --- a/src/test/resources/expectedDdlDiff.txt +++ b/src/test/resources/expectedDdlDiff.txt @@ -105,24 +105,24 @@ DROP TABLE test2 ALTER TABLE test1 ADD COLUMN col3 INT64 CREATE TABLE test3 ( col1 INT64 ) PRIMARY KEY (col1 ASC) CREATE INDEX index1 ON test1 ( col3 ASC ) -ALTER TABLE test3 ADD CONSTRAINT ch_in_test3 CHECK (col1 = col3 AND col1 > 100 AND col2 < -50) +ALTER TABLE test3 ADD CONSTRAINT ch_in_test3 CHECK (col1 = col3 and col1 > 100 and col2 < -50) ALTER TABLE test3 ADD CONSTRAINT fk_in_test3 FOREIGN KEY ( col3 ) REFERENCES othertable ( othercol ) ON DELETE NO ACTION -ALTER TABLE test1 ADD CONSTRAINT ch_in_test1 CHECK (col1 = col3 AND col1 > 100 AND col2 < -50) +ALTER TABLE test1 ADD CONSTRAINT ch_in_test1 CHECK (col1 = col3 and col1 > 100 and col2 < -50) ALTER TABLE test1 ADD CONSTRAINT fk_in_test1 FOREIGN KEY ( col3 ) REFERENCES othertable ( othercol ) ON DELETE NO ACTION == TEST 16 add check constraint via alter statement -ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 AND col1 > 100 AND col2 < -50) +ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 and col1 > 100 and col2 < -50) == TEST 17 modify check constraint in table ALTER TABLE test1 DROP CONSTRAINT ch_in_table -ALTER TABLE test1 ADD CONSTRAINT ch_in_table CHECK (col1 = col2 AND col1 > 200 AND col2 < -500) +ALTER TABLE test1 ADD CONSTRAINT ch_in_table CHECK (col1 = col2 and col1 > 200 and col2 < -500) == TEST 18 modify check constraint via alter statement ALTER TABLE test1 DROP CONSTRAINT ch_in_alter -ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 AND col1 > 200 AND col2 < -500) +ALTER TABLE test1 ADD CONSTRAINT ch_in_alter CHECK (col1 = col2 and col1 > 200 and col2 < -500) == TEST 19 drop check constraint in table