mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
Added the url modules test files.
Added the new url module test file. This replaces the original helpers_test.go file. The TestUrlPrep test currently fails. The only minor change to url.go is to add some trace printf's to UrlPrep.
This commit is contained in:
parent
57cd953997
commit
6b619d2cd6
2 changed files with 102 additions and 0 deletions
|
@ -81,6 +81,7 @@ func MakePermalink(host, plink string) *url.URL {
|
|||
func UrlPrep(ugly bool, in string) string {
|
||||
if ugly {
|
||||
x := Uglify(SanitizeUrl(in))
|
||||
fmt.Printf("Ugly case. Returning x = %q\n", x)
|
||||
return x
|
||||
} else {
|
||||
x := PrettifyUrl(SanitizeUrl(in))
|
||||
|
@ -89,8 +90,10 @@ func UrlPrep(ugly bool, in string) string {
|
|||
}
|
||||
url, err := purell.NormalizeURLString(x, purell.FlagAddTrailingSlash)
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR returned by NormalizeURLString. Returning in = %q\n", in)
|
||||
return in
|
||||
}
|
||||
fmt.Printf("NO error returning url = %q\n", url)
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue