<commit_before>package zest

import (
	"os"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

// TestCli runs tests on the zest Cli and SetCli methods.
func TestCli(t *testing.T) {
	a := assert.New(t)
	r := require.New(t)
	zest := New()

	r.NotPanics(func() { _ = zest.Cli() })
	cli := zest.Cli()

	cli.Name = "foobar"
	zest.SetCli(cli)

	r.NotPanics(func() { _ = zest.Cli() })
	cli = zest.Cli()

	a.Equal(cli.Name, "foobar")

	zest = Classic() // Should also work with the Classic zest

	r.NotPanics(func() { _ = zest.Cli() })
	cli = zest.Cli()

	cli.Name = "foobar"
	zest.SetCli(cli)

	r.NotPanics(func() { _ = zest.Cli() })
	cli = zest.Cli()

	a.Equal(cli.Name, "foobar")
}

// TestRun runs tests on the zest Run method.
func TestRun(t *testing.T) {
	os.Args = []string{"zest", "--port", "3001"}

	// Just test that Run doesn't bomb
	go Classic().Run()
}<commit_msg>Run test fixed.<commit_after>package zest

import (
	"os"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

// TestCli runs tests on the zest Cli and SetCli methods.
func TestCli(t *testing.T) {
	a := assert.New(t)
	r := require.New(t)
	zest := New()

	r.NotPanics(func() { _ = zest.Cli() })
	cli := zest.Cli()

	cli.Name = "foobar"
	zest.SetCli(cli)

	r.NotPanics(func() { _ = zest.Cli() })
	cli = zest.Cli()

	a.Equal(cli.Name, "foobar")

	zest = Classic() // should also work with the Classic zest

	r.NotPanics(func() { _ = zest.Cli() })
	cli = zest.Cli()

	cli.Name = "foobar"
	zest.SetCli(cli)

	r.NotPanics(func() { _ = zest.Cli() })
	cli = zest.Cli()

	a.Equal(cli.Name, "foobar")
}

// TestRun runs tests on the zest Run method.
func TestRun(t *testing.T) {
	os.Args = []string{"zest"}

	go Classic().Run()

	time.Sleep(time.Millisecond) // a better way to do this ?
}
{'fraction_non_alphanumeric': 0.1855277475516866, 'fraction_numerical': 0.002176278563656148, 'mean_word_length': 3.4100719424460433, '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': '1818283', 'n_tokens_mistral': 823, 'n_tokens_neox': 762, 'n_words': 170}