mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-04 02:12:36 +02:00
19 lines
486 B
Go
19 lines
486 B
Go
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package files
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCleanUploadFileName(t *testing.T) {
|
|
assert.Equal(t, "", CleanGitTreePath("")) //nolint
|
|
assert.Equal(t, "", CleanGitTreePath(".")) //nolint
|
|
assert.Equal(t, "a/b", CleanGitTreePath("a/b"))
|
|
assert.Equal(t, "", CleanGitTreePath(".git/b")) //nolint
|
|
assert.Equal(t, "", CleanGitTreePath("a/.git")) //nolint
|
|
}
|