44package renderhelper
55
66import (
7- "context"
87 "testing"
98
109 repo_model "code.gitea.io/gitea/models/repo"
@@ -22,7 +21,7 @@ func TestRepoFile(t *testing.T) {
2221 repo1 := unittest .AssertExistsAndLoadBean (t , & repo_model.Repository {ID : 1 })
2322
2423 t .Run ("AutoLink" , func (t * testing.T ) {
25- rctx := NewRenderContextRepoFile (context . Background (), repo1 ).WithMarkupType (markdown .MarkupName )
24+ rctx := NewRenderContextRepoFile (t . Context (), repo1 ).WithMarkupType (markdown .MarkupName )
2625 rendered , err := markup .RenderString (rctx , `
272665f1bf27bc3bf70f64657658635e66094edbcb4d
2827#1
@@ -37,7 +36,7 @@ func TestRepoFile(t *testing.T) {
3736 })
3837
3938 t .Run ("AbsoluteAndRelative" , func (t * testing.T ) {
40- rctx := NewRenderContextRepoFile (context . Background (), repo1 , RepoFileOptions {CurrentRefPath : "branch/main" }).
39+ rctx := NewRenderContextRepoFile (t . Context (), repo1 , RepoFileOptions {CurrentRefPath : "branch/main" }).
4140 WithMarkupType (markdown .MarkupName )
4241 rendered , err := markup .RenderString (rctx , `
4342[/test](/test)
@@ -55,7 +54,7 @@ func TestRepoFile(t *testing.T) {
5554 })
5655
5756 t .Run ("WithCurrentRefPath" , func (t * testing.T ) {
58- rctx := NewRenderContextRepoFile (context . Background (), repo1 , RepoFileOptions {CurrentRefPath : "/commit/1234" }).
57+ rctx := NewRenderContextRepoFile (t . Context (), repo1 , RepoFileOptions {CurrentRefPath : "/commit/1234" }).
5958 WithMarkupType (markdown .MarkupName )
6059 rendered , err := markup .RenderString (rctx , `
6160[/test](/test)
@@ -68,7 +67,7 @@ func TestRepoFile(t *testing.T) {
6867 })
6968
7069 t .Run ("WithCurrentRefPathByTag" , func (t * testing.T ) {
71- rctx := NewRenderContextRepoFile (context . Background (), repo1 , RepoFileOptions {
70+ rctx := NewRenderContextRepoFile (t . Context (), repo1 , RepoFileOptions {
7271 CurrentRefPath : "/commit/1234" ,
7372 CurrentTreePath : "my-dir" ,
7473 }).
@@ -89,7 +88,7 @@ func TestRepoFileOrgMode(t *testing.T) {
8988 repo1 := unittest .AssertExistsAndLoadBean (t , & repo_model.Repository {ID : 1 })
9089
9190 t .Run ("Links" , func (t * testing.T ) {
92- rctx := NewRenderContextRepoFile (context . Background (), repo1 , RepoFileOptions {
91+ rctx := NewRenderContextRepoFile (t . Context (), repo1 , RepoFileOptions {
9392 CurrentRefPath : "/commit/1234" ,
9493 CurrentTreePath : "my-dir" ,
9594 }).WithRelativePath ("my-dir/a.org" )
@@ -106,7 +105,7 @@ func TestRepoFileOrgMode(t *testing.T) {
106105 })
107106
108107 t .Run ("CodeHighlight" , func (t * testing.T ) {
109- rctx := NewRenderContextRepoFile (context . Background (), repo1 , RepoFileOptions {}).WithRelativePath ("my-dir/a.org" )
108+ rctx := NewRenderContextRepoFile (t . Context (), repo1 , RepoFileOptions {}).WithRelativePath ("my-dir/a.org" )
110109
111110 rendered , err := markup .RenderString (rctx , `
112111#+begin_src c
0 commit comments