<commit_before>package hotspot

import (
	"path"
	"testing"

	"github.com/ready-steady/support/assert"
)

const (
	fixturePath = "fixtures"
)

func TestNew(t *testing.T) {
	model := New(findFixture("002.flp"), findFixture("hotspot.config"), "")

	assert.Equal(model.Cores, uint(2), t)
	assert.Equal(model.Nodes, uint(20), t)

	assert.AlmostEqual(model.C, fixtureC, t)
	assert.AlmostEqual(model.G, fixtureG, t)
}

func TestNewWithParams(t *testing.T) {
	model := New(findFixture("002.flp"), findFixture("hotspot.config"),
		"t_chip 0.00042 k_chip 42")

	assert.AlmostEqual(model.C, fixtureC42, t)
	assert.AlmostEqual(model.G, fixtureG42, t)
}

func BenchmarkLoad(b *testing.B) {
	floorplan := findFixture("032.flp")
	config := findFixture("hotspot.config")
	params := ""

	for i := 0; i < b.N; i++ {
		New(floorplan, config, params)<commit_msg>Replaced AlmostEqual with EqualWithin<commit_after>package hotspot

import (
	"path"
	"testing"

	"github.com/ready-steady/support/assert"
)

const (
	fixturePath = "fixtures"
)

func TestNew(t *testing.T) {
	model := New(findFixture("002.flp"), findFixture("hotspot.config"), "")

	assert.Equal(model.Cores, uint(2), t)
	assert.Equal(model.Nodes, uint(20), t)

	assert.EqualWithin(model.C, fixtureC, 2e-15, t)
	assert.EqualWithin(model.G, fixtureG, 2e-14, t)
}

func TestNewWithParams(t *testing.T) {
	model := New(findFixture("002.flp"), findFixture("hotspot.config"),
		"t_chip 0.00042 k_chip 42")

	assert.EqualWithin(model.C, fixtureC42, 1e-15, t)
	assert.EqualWithin(model.G, fixtureG42, 1e-15, t)
}

func BenchmarkLoad(b *testing.B) {
	floorplan := findFixture("032.flp")
	config := findFixture("hotspot.config")
	params := ""

	for i := 0; i < b.N; i++ {
		New(floorplan, config, params)
{'fraction_non_alphanumeric': 0.17261219792865362, 'fraction_numerical': 0.03567318757192175, 'mean_word_length': 5.080419580419581, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6044856', 'n_tokens_mistral': 748, 'n_tokens_neox': 679, 'n_words': 126}