1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-27 05:44:38 +01:00
gojekyll/helpers/path_test.go

21 lines
482 B
Go

package helpers
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestTrimExt(t *testing.T) {
require.Equal(t, "/a/b", TrimExt("/a/b.c"))
require.Equal(t, "/a/b", TrimExt("/a/b"))
}
func TestURLPathClean(t *testing.T) {
require.Equal(t, "/a/b", URLPathClean("/a/b"))
require.Equal(t, "/a/b/", URLPathClean("/a/b/"))
require.Equal(t, "/a/b", URLPathClean("/a//b"))
require.Equal(t, "/b", URLPathClean("/a/../b"))
require.Equal(t, "/", URLPathClean("/"))
}