mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
Source files keep their SPDX-License-Identifier and Hanzo copyright line; the Gitea, Gogs and LFS Test Server copyrights they used to repeat now live once in NOTICE, alongside LICENSE. The header lint accepts any copyright line above the SPDX line, so it no longer demands an upstream one. Co-authored-by: Hanzo Dev <[email protected]>
35 lines
850 B
Go
35 lines
850 B
Go
// Copyright 2026 Hanzo AI, Inc. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package renderhelper
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/hanzoai/git/models/unittest"
|
|
"github.com/hanzoai/git/modules/markup"
|
|
)
|
|
|
|
func testRenderString(ctx *markup.RenderContext, content string) (string, error) {
|
|
var buf strings.Builder
|
|
err := markup.Render(ctx, strings.NewReader(content), &buf)
|
|
return buf.String(), err
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
unittest.MainTest(m, &unittest.TestOptions{
|
|
FixtureFiles: []string{"repository.yml", "user.yml"},
|
|
SetUp: func() error {
|
|
markup.RenderBehaviorForTesting.DisableAdditionalAttributes = true
|
|
markup.Init(&markup.RenderHelperFuncs{
|
|
IsUsernameMentionable: func(ctx context.Context, username string) bool {
|
|
return username == "user2"
|
|
},
|
|
})
|
|
return nil
|
|
},
|
|
})
|
|
}
|