aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-10-05 12:17:16 +0800
committerGitHub <noreply@github.com>2022-10-05 12:17:16 +0800
commit1a9ba1c65da37309e5aca2416dbbe1de53396a74 (patch)
tree41b35905989cc3d26dabaae03774257962133ac2
parentcbebcc1c26bdc57966023bf51dd75d80be4c5beb (diff)
downloadgitea-1a9ba1c65da37309e5aca2416dbbe1de53396a74.tar.gz
gitea-1a9ba1c65da37309e5aca2416dbbe1de53396a74.zip
Fix missing m.Run() in TestMain (#21341)
Backport #21340, add the missing m.Run()
-rw-r--r--modules/markup/html_test.go4
-rw-r--r--modules/markup/markdown/markdown_test.go2
2 files changed, 5 insertions, 1 deletions
diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go
index a7cf81250b..f0dd79da71 100644
--- a/modules/markup/html_test.go
+++ b/modules/markup/html_test.go
@@ -7,6 +7,7 @@ package markup_test
import (
"context"
"io"
+ "os"
"strings"
"testing"
@@ -32,6 +33,7 @@ func TestMain(m *testing.M) {
if err := git.InitSimple(context.Background()); err != nil {
log.Fatal("git init failed, err: %v", err)
}
+ os.Exit(m.Run())
}
func TestRender_Commits(t *testing.T) {
@@ -336,7 +338,7 @@ func TestRender_emoji(t *testing.T) {
`<p>Some text with <span class="emoji" aria-label="grinning face with smiling eyes">😄</span><span class="emoji" aria-label="grinning face with smiling eyes">😄</span> 2 emoji next to each other</p>`)
test(
"😎ðŸĪŠðŸ”ðŸĪ‘❓",
- `<p><span class="emoji" aria-label="smiling face with sunglasses">😎</span><span class="emoji" aria-label="zany face">ðŸĪŠ</span><span class="emoji" aria-label="locked with key">🔐</span><span class="emoji" aria-label="money-mouth face">ðŸĪ‘</span><span class="emoji" aria-label="question mark">❓</span></p>`)
+ `<p><span class="emoji" aria-label="smiling face with sunglasses">😎</span><span class="emoji" aria-label="zany face">ðŸĪŠ</span><span class="emoji" aria-label="locked with key">🔐</span><span class="emoji" aria-label="money-mouth face">ðŸĪ‘</span><span class="emoji" aria-label="red question mark">❓</span></p>`)
// should match nothing
test(
diff --git a/modules/markup/markdown/markdown_test.go b/modules/markup/markdown/markdown_test.go
index 732fe1a6be..4fc6ec7c3f 100644
--- a/modules/markup/markdown/markdown_test.go
+++ b/modules/markup/markdown/markdown_test.go
@@ -6,6 +6,7 @@ package markdown_test
import (
"context"
+ "os"
"strings"
"testing"
@@ -37,6 +38,7 @@ func TestMain(m *testing.M) {
if err := git.InitSimple(context.Background()); err != nil {
log.Fatal("git init failed, err: %v", err)
}
+ os.Exit(m.Run())
}
func TestRender_StandardLinks(t *testing.T) {