From b7952f9061af1a9fd1aa1e7d749e3d0735af2660 Mon Sep 17 00:00:00 2001 From: Patrick Seeburger Date: Fri, 28 Sep 2018 12:08:36 +0200 Subject: [PATCH] Fix TestParseProtocolBgp() Fix test method TestParseProtocolBgp() to match the output of the current ProtocolsBgp() method wich returns Parsed records instead of a string array. --- bird/parser_test.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bird/parser_test.go b/bird/parser_test.go index b16744f..0229b5c 100644 --- a/bird/parser_test.go +++ b/bird/parser_test.go @@ -53,14 +53,7 @@ func TestParseProtocolBgp(t *testing.T) { p := parseProtocols(f) log.Printf("%# v", pretty.Formatter(p)) - lines := p["protocols"].([]string) - - protocols := []Parsed{} - - for _, v := range lines { - p2 := parseProtocol(v) - protocols = append(protocols, p2) - } + protocols := p["protocols"].(Parsed) if len(protocols) != 3 { //log.Printf("%# v", pretty.Formatter(protocols)) @@ -68,7 +61,6 @@ func TestParseProtocolBgp(t *testing.T) { } fmt.Println(protocols) - } func TestParseRoutesAllIpv4Bird1(t *testing.T) {