<commit_before>package main

import (
	"io/ioutil"
	"net/http"
	"testing"

	"github.com/gavv/httpexpect"
)

var tests = []struct {
	inFile  string
	outFile string
}{
	{
		inFile:  "./testresource/csv_1_in.json",
		outFile: "./testresource/csv_1_out",
	},
}

func irisTester(t *testing.T) *httpexpect.Expect {
	api := IrisAPI()

	return httpexpect.WithConfig(httpexpect.Config{
		// BaseURL: "http://localhost:9292",
		Client: &http.Client{
			Transport: httpexpect.NewFastBinder(api.ListenVirtual().Handler),
			Jar:       httpexpect.NewJar(),
		},
		Reporter: httpexpect.NewAssertReporter(t),
		Printers: []httpexpect.Printer{
			httpexpect.NewDebugPrinter(t, true),
		},
	})
}

func TestCsv(t *testing.T) {
	// if testing.Short() {
	//     t.Skip("skipping test in short mode.")
	// }

	for _, test := range tests {
		in, errIn := ioutil.ReadFile(test.inFile)<commit_msg>test: var tests -> integrationTests<commit_after>package main

import (
	"io/ioutil"
	"net/http"
	"testing"

	"github.com/gavv/httpexpect"
)

var integrationTests = []struct {
	inFile  string
	outFile string
}{
	{
		inFile:  "./testresource/csv_1_in.json",
		outFile: "./testresource/csv_1_out",
	},
}

func irisTester(t *testing.T) *httpexpect.Expect {
	api := IrisAPI()

	return httpexpect.WithConfig(httpexpect.Config{
		// BaseURL: "http://localhost:9292",
		Client: &http.Client{
			Transport: httpexpect.NewFastBinder(api.ListenVirtual().Handler),
			Jar:       httpexpect.NewJar(),
		},
		Reporter: httpexpect.NewAssertReporter(t),
		Printers: []httpexpect.Printer{
			httpexpect.NewDebugPrinter(t, true),
		},
	})
}

func TestCsv(t *testing.T) {
	// if testing.Short() {
	//     t.Skip("skipping test in short mode.")
	// }

	for _, test := range integrationTests {
		in, errIn := ioutil.ReadFile(test.inFile)
{'fraction_non_alphanumeric': 0.15921787709497207, 'fraction_numerical': 0.0067039106145251395, 'mean_word_length': 3.8405405405405406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1153688', 'n_tokens_mistral': 749, 'n_tokens_neox': 691, 'n_words': 116}