Skip to content

Commit

Permalink
Add test for map-eav without complete-insert
Browse files Browse the repository at this point in the history
  • Loading branch information
mpchadwick committed Nov 1, 2020
1 parent cbb9e24 commit ee2e627
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/eav_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@ func TestEavProcessLine(t *testing.T) {
eav.ProcessLine(") ENGINE=InnoDB AUTO_INCREMENT=180 DEFAULT CHARSET=utf8 COMMENT='Eav Attribute';")
eav.ProcessLine("/*!40101 SET character_set_client = @saved_cs_client */;")
eav.ProcessLine("INSERT INTO `eav_attribute` (`attribute_id`, `entity_type_id`, `attribute_code`) VALUES (1, 1, 'firstname');")
eav.ProcessLine("INSERT INTO `eav_attribute` VALUES (2, 1, 'lastname');")
r1 := false
r2 := false
for _, eavConfig := range eav.Config.Eav {
for k, v := range eavConfig.Attributes {
if k == "1" && v == "firstname" {
r1 = true
}
if k == "2" && v == "lastname" {
r2 = true
}
}
}

if !r1 {
t.Errorf("Got false wanted true")
}

if !r2 {
t.Errorf("Got false wanted true")
}

}

0 comments on commit ee2e627

Please sign in to comment.