Skip to content

Commit 5690058

Browse files
committed
Fix missing m.Run() in TestMain (go-gitea#21341)
Backport go-gitea#21340, add the missing m.Run()
1 parent 3b47dcc commit 5690058

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

modules/markup/html_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package markup_test
77
import (
88
"context"
99
"io"
10+
"os"
1011
"strings"
1112
"testing"
1213

@@ -32,6 +33,7 @@ func TestMain(m *testing.M) {
3233
if err := git.InitSimple(context.Background()); err != nil {
3334
log.Fatal("git init failed, err: %v", err)
3435
}
36+
os.Exit(m.Run())
3537
}
3638

3739
func TestRender_Commits(t *testing.T) {
@@ -336,7 +338,7 @@ func TestRender_emoji(t *testing.T) {
336338
`<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>`)
337339
test(
338340
"😎🤪🔐🤑❓",
339-
`<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>`)
341+
`<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>`)
340342

341343
// should match nothing
342344
test(

modules/markup/markdown/markdown_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package markdown_test
66

77
import (
88
"context"
9+
"os"
910
"strings"
1011
"testing"
1112

@@ -37,6 +38,7 @@ func TestMain(m *testing.M) {
3738
if err := git.InitSimple(context.Background()); err != nil {
3839
log.Fatal("git init failed, err: %v", err)
3940
}
41+
os.Exit(m.Run())
4042
}
4143

4244
func TestRender_StandardLinks(t *testing.T) {

0 commit comments

Comments
 (0)