diff options
author | 6543 <6543@obermui.de> | 2022-01-20 18:46:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-20 18:46:10 +0100 |
commit | 54e9ee37a7a301dbe74d46fd3c87712e6120e9bf (patch) | |
tree | 1be12fb072625c1b896b9d72f7912b018aad502b /modules/markup/html_test.go | |
parent | 1d98d205f5825f40110e6628b61a97c91ac7f72d (diff) | |
download | gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.tar.gz gitea-54e9ee37a7a301dbe74d46fd3c87712e6120e9bf.zip |
format with gofumpt (#18184)
* gofumpt -w -l .
* gofumpt -w -l -extra .
* Add linter
* manual fix
* change make fmt
Diffstat (limited to 'modules/markup/html_test.go')
-rw-r--r-- | modules/markup/html_test.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index 2824dca504..ee9b17df2f 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -38,17 +38,17 @@ func TestRender_Commits(t *testing.T) { assert.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(buffer)) } - var sha = "65f1bf27bc3bf70f64657658635e66094edbcb4d" - var repo = TestRepoURL - var commit = util.URLJoin(repo, "commit", sha) - var tree = util.URLJoin(repo, "tree", sha, "src") - - var file = util.URLJoin(repo, "commit", sha, "example.txt") - var fileWithExtra = file + ":" - var fileWithHash = file + "#L2" - var fileWithHasExtra = file + "#L2:" - var commitCompare = util.URLJoin(repo, "compare", sha+"..."+sha) - var commitCompareWithHash = commitCompare + "#L2" + sha := "65f1bf27bc3bf70f64657658635e66094edbcb4d" + repo := TestRepoURL + commit := util.URLJoin(repo, "commit", sha) + tree := util.URLJoin(repo, "tree", sha, "src") + + file := util.URLJoin(repo, "commit", sha, "example.txt") + fileWithExtra := file + ":" + fileWithHash := file + "#L2" + fileWithHasExtra := file + "#L2:" + commitCompare := util.URLJoin(repo, "compare", sha+"..."+sha) + commitCompareWithHash := commitCompare + "#L2" test(sha, `<p><a href="`+commit+`" rel="nofollow"><code>65f1bf27bc</code></a></p>`) test(sha[:7], `<p><a href="`+commit[:len(commit)-(40-7)]+`" rel="nofollow"><code>65f1bf2</code></a></p>`) @@ -102,8 +102,8 @@ func TestRender_CrossReferences(t *testing.T) { func TestMisc_IsSameDomain(t *testing.T) { setting.AppURL = TestAppURL - var sha = "b6dd6210eaebc915fd5be5579c58cce4da2e2579" - var commit = util.URLJoin(TestRepoURL, "commit", sha) + sha := "b6dd6210eaebc915fd5be5579c58cce4da2e2579" + commit := util.URLJoin(TestRepoURL, "commit", sha) assert.True(t, IsSameDomain(commit)) assert.False(t, IsSameDomain("http://google.com/ncr")) @@ -291,7 +291,7 @@ func TestRender_emoji(t *testing.T) { `<p><span class="emoji" aria-label="`+emoji.GemojiData[i].Description+`">`+emoji.GemojiData[i].Emoji+`</span></p>`) } - //Text that should be turned into or recognized as emoji + // Text that should be turned into or recognized as emoji test( ":gitea:", `<p><span class="emoji" aria-label="gitea"><img alt=":gitea:" src="`+setting.StaticURLPrefix+`/assets/img/emoji/gitea.png"/></span></p>`) @@ -472,7 +472,7 @@ func TestRender_RelativeImages(t *testing.T) { func Test_ParseClusterFuzz(t *testing.T) { setting.AppURL = TestAppURL - var localMetas = map[string]string{ + localMetas := map[string]string{ "user": "go-gitea", "repo": "gitea", } @@ -502,7 +502,7 @@ func Test_ParseClusterFuzz(t *testing.T) { func TestIssue16020(t *testing.T) { setting.AppURL = TestAppURL - var localMetas = map[string]string{ + localMetas := map[string]string{ "user": "go-gitea", "repo": "gitea", } |