Skip to content

Commit

Permalink
Fix missing m.Run() in TestMain (#21341)
Browse files Browse the repository at this point in the history
Backport #21340, add the missing m.Run()
  • Loading branch information
wxiaoguang authored Oct 5, 2022
1 parent cbebcc1 commit 1a9ba1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/markup/html_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package markup_test
import (
"context"
"io"
"os"
"strings"
"testing"

Expand All @@ -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) {
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions modules/markup/markdown/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package markdown_test

import (
"context"
"os"
"strings"
"testing"

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 1a9ba1c

Please sign in to comment.