<commit_before>package golden

import (
	"flag"
	"testing"

	"github.com/jkomoros/boardgame/examples/blackjack"
	"github.com/workfit/tester/assert"
)

var updateGolden = flag.Bool("update-golden", false, "update golden files if they're different instead of erroring")

func TestBasic(t *testing.T) {

	err := Compare(blackjack.NewDelegate(), "test/basic_blackjack.json", *updateGolden)

	assert.For(t).ThatActual(err).IsNil()

}

func TestFolder(t *testing.T) {
	err := CompareFolder(blackjack.NewDelegate(), "test", *updateGolden)
	assert.For(t).ThatActual(err).IsNil()
}<commit_msg>Make it so golden's tests only rewrites the golden files for folder, so they don't sotmp on eachother. Part of #701. Part of #755.<commit_after>package golden

import (
	"flag"
	"testing"

	"github.com/jkomoros/boardgame/examples/blackjack"
	"github.com/workfit/tester/assert"
)

var updateGolden = flag.Bool("update-golden", false, "update golden files if they're different instead of erroring")

func TestBasic(t *testing.T) {

	//If we also used updateGolden here, then the two tests would collide.
	err := Compare(blackjack.NewDelegate(), "test/basic_blackjack.json", false)

	assert.For(t).ThatActual(err).IsNil()

}

func TestFolder(t *testing.T) {
	err := CompareFolder(blackjack.NewDelegate(), "test", *updateGolden)
	assert.For(t).ThatActual(err).IsNil()
}
{'fraction_non_alphanumeric': 0.14158636026686433, 'fraction_numerical': 0.004447739065974796, 'mean_word_length': 5.45933014354067, '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': '1067141', 'n_tokens_mistral': 483, 'n_tokens_neox': 461, 'n_words': 107}