<commit_before>package accounting

import (
	"math"
	"testing"
)

func TestFormatNumber(t *testing.T) {
	AssertEqual(t, FormatNumber(123456789.213123, 3, ",", "."), "123,456,789.213")
	AssertEqual(t, FormatNumber(123456789.213123, 3, ".", ","), "123.456.789,213")
	AssertEqual(t, FormatNumber(-12345.123123, 5, ",", "."), "-12,345.12312")
	AssertEqual(t, FormatNumber(-1234.123123, 5, ",", "."), "-1,234.12312")
	AssertEqual(t, FormatNumber(-123.123123, 5, ",", "."), "-123.12312")
	AssertEqual(t, FormatNumber(-12.123123, 5, ",", "."), "-12.12312")
	AssertEqual(t, FormatNumber(-1.123123, 5, ",", "."), "-1.12312")
	AssertEqual(t, FormatNumber(math.MaxInt64, 10, ",", "."), "9,223,372,036,854,775,807.0000000000")
	AssertEqual(t, FormatNumber(math.MinInt64, 10, ",", "."), "-9,223,372,036,854,775,808.0000000000")
	AssertEqual(t, FormatNumber(-1, 3, ",", "."), "-1.000")
	AssertEqual(t, FormatNumber(-10, 3, ",", "."), "-10.000")
	AssertEqual(t, FormatNumber(-100, 3, ",", "."), "-100.000")
	AssertEqual(t, FormatNumber(-1000, 3, ",", "."), "-1,000.000")
	AssertEqual(t, FormatNumber(-10000, 3, ",", "."), "-10,000.000")
	AssertEqual(t, FormatNumber(-100000, 3, ",", "."), "-100,000.000")
	AssertEqual(t, FormatNumber(-1000000, 3, ",", "."), "-1,000,000.000")
	AssertEqual(t, FormatNumber(1, 3, ",", "."), "1.000")
	AssertEqual(t, FormatNumber(10, 3, ",", "."), "10.000")
	AssertEqual(t, FormatNumber(100, 3, ",", "."), "100.000")
	AssertEqual(t, FormatNumber(1000, 3, ",", "."), "1,000.000")
	AssertEqual(t, FormatNumber(10000, 3, ",", "."), "10,000.000")
	AssertEqual(t, FormatNumber(100000, 3, ",", "."), "100,000.000")
	AssertEqual(t, FormatNumber(1000000, 3, ",", "."), "1,000,000.000")
	AssertEqual(t, FormatNumber(1000000, 10, " ", "."), "1 000 000.0000000000")
	AssertEqual(t, FormatNumber(1000000, 10, "   ", "."), "1   000   000.0000000000")
}

func TestFormatNumberInt(t *testing.T) {
	AssertEqual(t, FormatNumberInt(math.MaxInt64, 10, ",", "."), "9,223,372,036,854,775,807.0000000000")
	AssertEqual(t, FormatNumberInt(math.MinInt64+1, 10, ",", "."), "-9,223,372,036,854,775,807.0000000000")
	AssertEqual(t, FormatNumberInt(math.MinInt64, 10, ",", "."), "-9,223,372,036,854,775,808.0000000000")
	AssertEqual(t, FormatNumberInt(-1, 3, ",", "."), "-1.000")
	AssertEqual(t, FormatNumberInt(-10, 3, ",", "."), "-10.000")
	AssertEqual(t, FormatNumberInt(-100, 3, ",", "."), "-100.000")
	AssertEqual(t, FormatNumberInt(-1000, 3, ",", "."), "-1,000.000")
	AssertEqual(t, FormatNumberInt(-10000, 3, ",", "."), "-10,000.000")
	AssertEqual(t, FormatNumberInt(-100000, 3, ",", "."), "-100,000.000")
	AssertEqual(t, FormatNumberInt(-1000000, 3, ",", "."), "-1,000,000.000")
	AssertEqual(t, FormatNumberInt(1, 3, ",", "."), "1.000")
	AssertEqual(t, FormatNumberInt(10, 3, ",", "."), "10.000")
	AssertEqual(t, FormatNumberInt(100, 3, ",", "."), "100.000")
	AssertEqual(t, FormatNumberInt(1000, 3, ",", "."), "1,000.000")
	AssertEqual(t, FormatNumberInt(10000, 3, ",", "."), "10,000.000")
	AssertEqual(t, FormatNumberInt(100000, 3, ",", "."), "100,000.000")
	AssertEqual(t, FormatNumberInt(1000000, 3, ",", "."), "1,000,000.000")
	AssertEqual(t, FormatNumberInt(1000000, 10, " ", "."), "1 000 000.0000000000")
	AssertEqual(t, FormatNumberInt(1000000, 10, "   ", "."), "1   000   000.0000000000")
}
<commit_msg>Improve test coverage.<commit_after>package accounting

import (
	"math"
	"testing"
)

func TestFormatNumber(t *testing.T) {
	AssertEqual(t, FormatNumber(123456789.213123, 3, ",", "."), "123,456,789.213")
	AssertEqual(t, FormatNumber(123456789.213123, 3, ".", ","), "123.456.789,213")
	AssertEqual(t, FormatNumber(-12345.123123, 5, ",", "."), "-12,345.12312")
	AssertEqual(t, FormatNumber(-1234.123123, 5, ",", "."), "-1,234.12312")
	AssertEqual(t, FormatNumber(-123.123123, 5, ",", "."), "-123.12312")
	AssertEqual(t, FormatNumber(-12.123123, 5, ",", "."), "-12.12312")
	AssertEqual(t, FormatNumber(-1.123123, 5, ",", "."), "-1.12312")
	AssertEqual(t, FormatNumber(math.MaxInt64, 10, ",", "."), "9,223,372,036,854,775,807.0000000000")
	AssertEqual(t, FormatNumber(math.MinInt64, 10, ",", "."), "-9,223,372,036,854,775,808.0000000000")
	AssertEqual(t, FormatNumber(-1, 3, ",", "."), "-1.000")
	AssertEqual(t, FormatNumber(-10, 3, ",", "."), "-10.000")
	AssertEqual(t, FormatNumber(-100, 3, ",", "."), "-100.000")
	AssertEqual(t, FormatNumber(-1000, 3, ",", "."), "-1,000.000")
	AssertEqual(t, FormatNumber(-10000, 3, ",", "."), "-10,000.000")
	AssertEqual(t, FormatNumber(-100000, 3, ",", "."), "-100,000.000")
	AssertEqual(t, FormatNumber(-1000000, 3, ",", "."), "-1,000,000.000")
	AssertEqual(t, FormatNumber(1, 3, ",", "."), "1.000")
	AssertEqual(t, FormatNumber(10, 3, ",", "."), "10.000")
	AssertEqual(t, FormatNumber(100, 3, ",", "."), "100.000")
	AssertEqual(t, FormatNumber(1000, 3, ",", "."), "1,000.000")
	AssertEqual(t, FormatNumber(10000, 3, ",", "."), "10,000.000")
	AssertEqual(t, FormatNumber(100000, 3, ",", "."), "100,000.000")
	AssertEqual(t, FormatNumber(1000000, 3, ",", "."), "1,000,000.000")
	AssertEqual(t, FormatNumber(1000000, 10, " ", "."), "1 000 000.0000000000")
	AssertEqual(t, FormatNumber(1000000, 10, "   ", "."), "1   000   000.0000000000")
	AssertEqual(t, FormatNumber(uint(1000000), 3, ",", "."), "1,000,000.000")
	AssertEqual(t, FormatNumber(false, 3, ",", "."), "")
}

func TestFormatNumberInt(t *testing.T) {
	AssertEqual(t, FormatNumberInt(math.MaxInt64, 10, ",", "."), "9,223,372,036,854,775,807.0000000000")
	AssertEqual(t, FormatNumberInt(math.MinInt64+1, 10, ",", "."), "-9,223,372,036,854,775,807.0000000000")
	AssertEqual(t, FormatNumberInt(math.MinInt64, 10, ",", "."), "-9,223,372,036,854,775,808.0000000000")
	AssertEqual(t, FormatNumberInt(-1, 3, ",", "."), "-1.000")
	AssertEqual(t, FormatNumberInt(-10, 3, ",", "."), "-10.000")
	AssertEqual(t, FormatNumberInt(-100, 3, ",", "."), "-100.000")
	AssertEqual(t, FormatNumberInt(-1000, 3, ",", "."), "-1,000.000")
	AssertEqual(t, FormatNumberInt(-10000, 3, ",", "."), "-10,000.000")
	AssertEqual(t, FormatNumberInt(-100000, 3, ",", "."), "-100,000.000")
	AssertEqual(t, FormatNumberInt(-1000000, 3, ",", "."), "-1,000,000.000")
	AssertEqual(t, FormatNumberInt(1, 3, ",", "."), "1.000")
	AssertEqual(t, FormatNumberInt(10, 3, ",", "."), "10.000")
	AssertEqual(t, FormatNumberInt(100, 3, ",", "."), "100.000")
	AssertEqual(t, FormatNumberInt(1000, 3, ",", "."), "1,000.000")
	AssertEqual(t, FormatNumberInt(10000, 3, ",", "."), "10,000.000")
	AssertEqual(t, FormatNumberInt(100000, 3, ",", "."), "100,000.000")
	AssertEqual(t, FormatNumberInt(1000000, 3, ",", "."), "1,000,000.000")
	AssertEqual(t, FormatNumberInt(1000000, 10, " ", "."), "1 000 000.0000000000")
	AssertEqual(t, FormatNumberInt(1000000, 10, "   ", "."), "1   000   000.0000000000")
}

{'fraction_non_alphanumeric': 0.2781398104265403, 'fraction_numerical': 0.2255627962085308, 'mean_word_length': 5.640117994100295, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 18, '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': '4399094', 'n_tokens_mistral': 3765, 'n_tokens_neox': 2624, 'n_words': 399}