3 Star 12 Fork 2

Git工具集/git-lfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
git_fetcher_test.go 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
package config
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGetCanonicalization(t *testing.T) {
vals := map[string][]string{
"user.name": []string{"Pat Doe"},
"branch.MixedCase.pushremote": []string{"Somewhere"},
"http.https://example.com/BIG-TEXT.git.extraheader": []string{"X-Foo: Bar"},
}
fetcher := GitFetcher{vals: vals}
assert.Equal(t, []string{"Somewhere"}, fetcher.GetAll("bRanch.MixedCase.pushRemote"))
assert.Equal(t, []string{"Somewhere"}, fetcher.GetAll("branch.MixedCase.pushremote"))
assert.Equal(t, []string(nil), fetcher.GetAll("branch.mixedcase.pushremote"))
assert.Equal(t, []string{"Pat Doe"}, fetcher.GetAll("user.name"))
assert.Equal(t, []string{"Pat Doe"}, fetcher.GetAll("User.Name"))
assert.Equal(t, []string{"X-Foo: Bar"}, fetcher.GetAll("http.https://example.com/BIG-TEXT.git.extraheader"))
assert.Equal(t, []string{"X-Foo: Bar"}, fetcher.GetAll("http.https://example.com/BIG-TEXT.git.extraHeader"))
assert.Equal(t, []string(nil), fetcher.GetAll("http.https://example.com/big-text.git.extraHeader"))
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/vcs-all-in-one/git-lfs.git
git@gitee.com:vcs-all-in-one/git-lfs.git
vcs-all-in-one
git-lfs
git-lfs
master

搜索帮助