From ee2e627b43a383103d1cf5c4a09efb21fe091533 Mon Sep 17 00:00:00 2001 From: Max Chadwick Date: Sat, 31 Oct 2020 21:22:19 -0400 Subject: [PATCH] Add test for map-eav without complete-insert --- src/eav_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/eav_test.go b/src/eav_test.go index 81c00a8..b11bbbb 100644 --- a/src/eav_test.go +++ b/src/eav_test.go @@ -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") } } \ No newline at end of file