mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-01 15:39:12 -05:00
parent
b110d0ae04
commit
1e233b1c45
1 changed files with 10 additions and 9 deletions
|
@ -13,12 +13,13 @@
|
||||||
|
|
||||||
package commands
|
package commands
|
||||||
|
|
||||||
// "testing"
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
// "github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
)
|
||||||
|
|
||||||
// TODO(bep) cli refactor fix me
|
func TestFixURL(t *testing.T) {
|
||||||
/*func TestFixURL(t *testing.T) {
|
|
||||||
type data struct {
|
type data struct {
|
||||||
TestName string
|
TestName string
|
||||||
CLIBaseURL string
|
CLIBaseURL string
|
||||||
|
@ -41,12 +42,13 @@ package commands
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, test := range tests {
|
for i, test := range tests {
|
||||||
|
s := newServerCmd()
|
||||||
v := viper.New()
|
v := viper.New()
|
||||||
baseURL = test.CLIBaseURL
|
baseURL := test.CLIBaseURL
|
||||||
v.Set("baseURL", test.CfgBaseURL)
|
v.Set("baseURL", test.CfgBaseURL)
|
||||||
serverAppend = test.AppendPort
|
s.serverAppend = test.AppendPort
|
||||||
serverPort = test.Port
|
s.serverPort = test.Port
|
||||||
result, err := fixURL(v, baseURL, serverPort)
|
result, err := s.fixURL(v, baseURL, s.serverPort)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Test #%d %s: unexpected error %s", i, test.TestName, err)
|
t.Errorf("Test #%d %s: unexpected error %s", i, test.TestName, err)
|
||||||
}
|
}
|
||||||
|
@ -55,4 +57,3 @@ package commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in a new issue