From bc859bae547b4c651b0637c523669d4f3d5ef13d Mon Sep 17 00:00:00 2001 From: "Hristos N. Triantafillou" Date: Sat, 29 Feb 2020 11:38:40 -0600 Subject: [PATCH] DRY this bit up --- obpmg_test.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/obpmg_test.go b/obpmg_test.go index 2c93f1c..1f6854b 100644 --- a/obpmg_test.go +++ b/obpmg_test.go @@ -17,7 +17,6 @@ package main import ( - "encoding/xml" "testing" ) @@ -64,21 +63,7 @@ func TestGetYamlDataReallyBad(t *testing.T) { func TestToXml(t *testing.T) { y, _ := getYamlData("sample.yml", false) - x := &xmlOpenboxPipeMenu{} - - for _, data := range y { - x.Items = append(x.Items, xmlItem{ - xml.Name{}, - xmlAction{ - xml.Name{}, - "Execute", - data.Exe, - }, - data.Label, - }, - ) - } - + x := yamlDataToX(&xmlOpenboxPipeMenu{}, y) xb := toXml(x) expected := "\n\n \n \n /home/hristos/games/FTL/FTL\n \n \n \n \n /usr/bin/MultiMC\n \n \n \n \n /opt/morrowind/openmw/bin/openmw-launcher\n \n \n\n" -- 2.45.2