diff options
Diffstat (limited to 'helpers/templates_test.go')
-rw-r--r-- | helpers/templates_test.go | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/helpers/templates_test.go b/helpers/templates_test.go deleted file mode 100644 index 7252c2d98..000000000 --- a/helpers/templates_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package helpers - -import ( - "testing" -) - -func TestMakePath(t *testing.T) { - tests := []struct { - input string - expected string - }{ - {" foo bar ", "foo-bar"}, - {"foo.bar/foo_bar-foo", "foo.bar/foo_bar-foo"}, - {"foo,bar:foo%bar", "foobarfoobar"}, - {"foo/bar.html", "foo/bar.html"}, - {"трям/трям", "трям/трям"}, - } - - for _, test := range tests { - output := MakePath(test.input) - if output != test.expected { - t.Errorf("Expected %#v, got %#v\n", test.expected, output) - } - } -} - -func TestUrlize(t *testing.T) { - tests := []struct { - input string - expected string - }{ - {" foo bar ", "foo-bar"}, - {"foo.bar/foo_bar-foo", "foo.bar/foo_bar-foo"}, - {"foo,bar:foo%bar", "foobarfoobar"}, - {"foo/bar.html", "foo/bar.html"}, - {"трям/трям", "%D1%82%D1%80%D1%8F%D0%BC/%D1%82%D1%80%D1%8F%D0%BC"}, - } - - for _, test := range tests { - output := Urlize(test.input) - if output != test.expected { - t.Errorf("Expected %#v, got %#v\n", test.expected, output) - } - } -} |