<commit_before>package nametemplate

import (
	"bytes"
	"testing"

	"github.com/apex/log"
	"github.com/apex/log/handlers/cli"
	"github.com/goreleaser/goreleaser/config"
	"github.com/goreleaser/goreleaser/context"
	"github.com/goreleaser/goreleaser/internal/artifact"
	"github.com/tj/assert"
)

func TestNameTemplate(t *testing.T) {
	var ctx = context.New(config.Project{
		ProjectName: "proj",
		Archive: config.Archive{
			NameTemplate: "{{.Binary}}_{{.ProjectName}}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}",
			Replacements: map[string]string{
				"windows": "windao",
			},
		},
	})
	s, err := Apply(ctx, artifact.Artifact{
		Goos:   "windows",
		Goarch: "amd64",
		Name:   "winbin",
	}, "bin")
	assert.NoError(t, err)
	assert.Equal(t, "bin_bin_windao_amd64", s)
	s, err = Apply(ctx, artifact.Artifact{
		Goos:   "darwin",
		Goarch: "amd64",
		Name:   "winbin",
	}, "bin")
	assert.NoError(t, err)<commit_msg>fix: import<commit_after>package nametemplate

import (
	"bytes"
	"testing"

	"github.com/apex/log"
	"github.com/apex/log/handlers/cli"
	"github.com/goreleaser/goreleaser/config"
	"github.com/goreleaser/goreleaser/context"
	"github.com/goreleaser/goreleaser/internal/artifact"
	"github.com/stretchr/testify/assert"
)

func TestNameTemplate(t *testing.T) {
	var ctx = context.New(config.Project{
		ProjectName: "proj",
		Archive: config.Archive{
			NameTemplate: "{{.Binary}}_{{.ProjectName}}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}",
			Replacements: map[string]string{
				"windows": "windao",
			},
		},
	})
	s, err := Apply(ctx, artifact.Artifact{
		Goos:   "windows",
		Goarch: "amd64",
		Name:   "winbin",
	}, "bin")
	assert.NoError(t, err)
	assert.Equal(t, "bin_bin_windao_amd64", s)
	s, err = Apply(ctx, artifact.Artifact{
		Goos:   "darwin",
		Goarch: "amd64",
		Name:   "winbin",
	}, "bin")
	assert.NoError(t, err)
{'fraction_non_alphanumeric': 0.19206008583690987, 'fraction_numerical': 0.006437768240343348, 'mean_word_length': 4.28328611898017, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6325292', 'n_tokens_mistral': 824, 'n_tokens_neox': 767, 'n_words': 126}