<commit_before>package config

import (
	"os"
	"testing"

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

func TestParseServerConfig(t *testing.T) {
	ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/delegated/server.conf")
	ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/fpaxos/server.conf")
	ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/simple/server.conf")
}


// TestParseServerConfig calls ParseServerConfig for the two example configuration files
func TestParseSingleServerConfig(t *testing.T) {
	conf := ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/simple/server.conf")

	assert.Equal(t, 100000, conf.Performance.Length)
	assert.Equal(t, 0, conf.Performance.BatchInterval)
	assert.Equal(t, 10, conf.Performance.MaxBatch)
	assert.Equal(t, 0, conf.Algorithm.DelegateReplication)
	assert.Equal(t, 1, conf.Performance.WindowSize)
	assert.Equal(t, 1000, conf.Performance.SnapshotInterval)
	assert.Equal(t, "strict majority", conf.Algorithm.QuorumSystem)
	assert.Equal(t, false, conf.Algorithm.IndexExclusivity)
	assert.Equal(t, "kv-store", conf.Application.Name)

	unsafe := conf.Unsafe
	assert.False(t, unsafe.DumpPersistentStorage)
	assert.Equal(t, "fsync", unsafe.PersistenceMode)

}<commit_msg>splitting server config file into subsections<commit_after>package config

import (
	"os"
	"testing"

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

func TestParseServerConfig(t *testing.T) {
	ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/delegated/server.conf")
	ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/fpaxos/server.conf")
	ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/simple/server.conf")
}


// TestParseServerConfig calls ParseServerConfig for the two example configuration files
func TestParseSingleServerConfig(t *testing.T) {
	conf := ParseServerConfig(os.Getenv("GOPATH") + "/src/github.com/heidi-ann/ios/configfiles/simple/server.conf")

	assert.Equal(t, 100000, conf.Performance.Length)
	assert.Equal(t, 0, conf.Performance.BatchInterval)
	assert.Equal(t, 10, conf.Performance.MaxBatch)
	assert.Equal(t, 0, conf.Algorithm.DelegateReplication)
	assert.Equal(t, 1, conf.Performance.WindowSize)
	assert.Equal(t, 1000, conf.Performance.SnapshotInterval)
	assert.Equal(t, "strict majority", conf.Algorithm.QuorumSystem)
	assert.Equal(t, false, conf.Algorithm.IndexExclusivity)
	assert.Equal(t, "kv-store", conf.Application.Name)

	assert.False(t, conf.Unsafe.DumpPersistentStorage)
	assert.Equal(t, "fsync", conf.Unsafe.PersistenceMode)

}
{'fraction_non_alphanumeric': 0.1443413729128015, 'fraction_numerical': 0.011131725417439703, 'mean_word_length': 6.076115485564304, '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': '4514215', 'n_tokens_mistral': 969, 'n_tokens_neox': 920, 'n_words': 133}