Skip to content

Commit

Permalink
Position tests for non complete-insert reliant implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
mpchadwick committed Nov 1, 2020
1 parent a3122b0 commit dd90c66
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ func TestProcessLine(t *testing.T) {
t.Errorf("Got %s wanted foobar", r1)
}

processor.ProcessLine("CREATE TABLE `admin_user` (")
processor.ProcessLine(" `firstname` varchar(32) DEFAULT NULL COMMENT 'User First Name'")
processor.ProcessLine(") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Admin User Table'")
processor.ProcessLine("/*!40101 SET character_set_client = @saved_cs_client */;")

r2 := processor.ProcessLine("INSERT INTO `admin_user` (`firstname`) VALUES ('bob');")
if strings.Contains(r2, "bob") {
t.Error("Got bob wanted no bob")
Expand All @@ -43,6 +48,12 @@ func TestProcessLine(t *testing.T) {
}
}

processor.ProcessLine("CREATE TABLE `customer_entity_varchar` (")
processor.ProcessLine(" `attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute Id',")
processor.ProcessLine(" `value` varchar(255) DEFAULT NULL COMMENT 'Value'")
processor.ProcessLine(") ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer Entity Varchar';")
processor.ProcessLine("/*!40101 SET character_set_client = @saved_cs_client */;")

r4 := processor.ProcessLine("INSERT INTO `customer_entity_varchar` (`attribute_id`, `value`) VALUES (1, 'bob');")
if strings.Contains(r4, "bob") {
t.Error("Got bob wanted no bob")
Expand Down

0 comments on commit dd90c66

Please sign in to comment.