File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11## Changelog
22
3+ ### Unreleased
4+
5+ #### Bug Fixes
6+
7+ * [ Issue #719 ] ( https://github.com/fabiolb/fabio/issues/719 ) : Fix detailed config log
8+
39### [ v1.5.12] ( https://github.com/fabiolb/fabio/releases/tag/v1.5.12 ) - 11 Oct 2019
410
511#### Breaking Changes
Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ func (t Table) String() string {
501501
502502// Dump returns the routing table as a detailed
503503func (t Table ) Dump () string {
504- var w * bytes.Buffer
504+ w := new ( bytes.Buffer )
505505
506506 hosts := []string {}
507507 for k := range t {
Original file line number Diff line number Diff line change @@ -731,3 +731,32 @@ func TestNewTableCustom(t *testing.T) {
731731 t .FailNow ()
732732 }
733733}
734+
735+ func TestTable_Dump (t * testing.T ) {
736+ s := `
737+ route add svc / http://foo.com:800
738+ route add svc /foo http://foo.com:900
739+ route add svc abc.com/ http://foo.com:1000
740+ `
741+
742+ tbl , err := NewTable (bytes .NewBufferString (s ))
743+ if err != nil {
744+ t .Fatal (err )
745+ }
746+
747+ want := `+-- host=
748+ | |-- path=/foo
749+ | | +-- addr=foo.com:900 weight 1.00 slots 1/1
750+ | +-- path=/
751+ | +-- addr=foo.com:800 weight 1.00 slots 1/1
752+ +-- host=abc.com
753+ +-- path=/
754+ +-- addr=foo.com:1000 weight 1.00 slots 1/1
755+ `
756+
757+ got := tbl .Dump ()
758+
759+ if want != got {
760+ t .Errorf ("Unexpected Dump() output:\n want:\n %s\n got:\n %s\n " , want , got )
761+ }
762+ }
You can’t perform that action at this time.
0 commit comments