<commit_before>package generators

import (
	"reflect"
	"testing"

	"github.com/davecgh/go-spew/spew"
	"github.com/yext/edward/common"
	"github.com/yext/edward/services"
)

var goTests = []struct {
	name        string
	path        string
	outServices []*services.ServiceConfig
	outErr      error
}{

	{
		name: "Go Simple",
		path: "testdata/go_simple/",
		outServices: []*services.ServiceConfig{
			&services.ServiceConfig{
				Name: "simple",
				Path: common.StringToStringPointer("testdata/go_simple/gocode/src/yext/simple"),
				Env:  []string{},
				Commands: services.ServiceConfigCommands{
					Build:  "go install",
					Launch: "simple",
				},
				Properties: services.ServiceConfigProperties{
					Started: "Listening",
				},
			},
		},
		outErr: nil,
	},
}

func TestGoGenerator(t *testing.T) {
	for _, test := range goTests {
		services, _, err := GenerateServices(test.path)<commit_msg>Fix test data, since paths are now handled correctly.<commit_after>package generators

import (
	"reflect"
	"testing"

	"github.com/davecgh/go-spew/spew"
	"github.com/yext/edward/common"
	"github.com/yext/edward/services"
)

var goTests = []struct {
	name        string
	path        string
	outServices []*services.ServiceConfig
	outErr      error
}{

	{
		name: "Go Simple",
		path: "testdata/go_simple/",
		outServices: []*services.ServiceConfig{
			&services.ServiceConfig{
				Name: "simple",
				Path: common.StringToStringPointer("gocode/src/yext/simple"),
				Env:  []string{},
				Commands: services.ServiceConfigCommands{
					Build:  "go install",
					Launch: "simple",
				},
				Properties: services.ServiceConfigProperties{
					Started: "Listening",
				},
			},
		},
		outErr: nil,
	},
}

func TestGoGenerator(t *testing.T) {
	for _, test := range goTests {
		services, _, err := GenerateServices(test.path)
{'fraction_non_alphanumeric': 0.13917808219178082, 'fraction_numerical': 0.0, 'mean_word_length': 3.4754901960784315, 'pattern_counts': {'":': 0, '<': 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': '3924813', 'n_tokens_mistral': 709, 'n_tokens_neox': 619, 'n_words': 119}