<commit_before>package main

import (
	"cgl.tideland.biz/asserts"
	"testing"
)

func TestConfig_ParseConfig_Bad(t *testing.T) {
	assert := asserts.NewTestingAsserts(t, true)

	data := `
	[commands]
	foo = bar
	`

	_, err := parseConfig(data)
	assert.NotNil(err, "should have an error")
}

func TestConfig_ParseConfig_Good(t *testing.T) {
	assert := asserts.NewTestingAsserts(t, true)

	data := `
	[commands]
	foo = "bar"
	`

	c, err := parseConfig(data)
	assert.Nil(err, "should not have an error")
	assert.Equal(c.CommandNames(), []string{"foo"}, "should have correct command names")
	assert.Equal(c.Commands["foo"], "bar", "should have the command")<commit_msg>packer: Test to ensure the default config can parse<commit_after>package main

import (
	"cgl.tideland.biz/asserts"
	"testing"
)

func TestConfig_ParseConfig_Bad(t *testing.T) {
	assert := asserts.NewTestingAsserts(t, true)

	data := `
	[commands]
	foo = bar
	`

	_, err := parseConfig(data)
	assert.NotNil(err, "should have an error")
}

func TestConfig_ParseConfig_DefaultConfig(t *testing.T) {
	assert := asserts.NewTestingAsserts(t, true)

	_, err := parseConfig(defaultConfig)
	assert.Nil(err, "should be able to parse the default config")
}

func TestConfig_ParseConfig_Good(t *testing.T) {
	assert := asserts.NewTestingAsserts(t, true)

	data := `
	[commands]
	foo = "bar"
	`

	c, err := parseConfig(data)
	assert.Nil(err, "should not have an error")
	assert.Equal(c.CommandNames(), []string{"foo"}, "should have correct command names")
	assert.Equal(c.Commands["foo"], "bar", "should have the command")
{'fraction_non_alphanumeric': 0.14621741894469167, 'fraction_numerical': 0.0, 'mean_word_length': 5.124513618677042, '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': '2917676', 'n_tokens_mistral': 566, 'n_tokens_neox': 551, 'n_words': 132}