0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-04 02:12:36 +02:00
wxiaoguang 4fc626daa1
Refactor editor (#34780)
A complete rewrite
2025-06-21 19:20:51 +08:00

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
}