<commit_before>package gometer

import (
	"testing"

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

func TestCounterAdd(t *testing.T) {
	c := DefaultCounter{}
	c.Add(10)
	assert.Equal(t, int64(10), c.Get())
}

func TestCounterSet(t *testing.T) {
	c := DefaultCounter{}
	c.Set(10)
	assert.Equal(t, int64(10), c.Get())

	c.Set(-10)
	assert.Equal(t, int64(-10), c.Get())
}

func TestCounterAddAndGet(t *testing.T)  {
	c := DefaultCounter{}
	v := c.AddAndGet(10)
	assert.Equal(t, int64(10), v)
	assert.Equal(t, int64(10), c.Get())

	v = c.AddAndGet(5)
	assert.Equal(t, int64(15), v)
	assert.Equal(t, int64(15), c.Get())
}<commit_msg>gofmt<commit_after>package gometer

import (
	"testing"

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

func TestCounterAdd(t *testing.T) {
	c := DefaultCounter{}
	c.Add(10)
	assert.Equal(t, int64(10), c.Get())
}

func TestCounterSet(t *testing.T) {
	c := DefaultCounter{}
	c.Set(10)
	assert.Equal(t, int64(10), c.Get())

	c.Set(-10)
	assert.Equal(t, int64(-10), c.Get())
}

func TestCounterAddAndGet(t *testing.T) {
	c := DefaultCounter{}
	v := c.AddAndGet(10)
	assert.Equal(t, int64(10), v)
	assert.Equal(t, int64(10), c.Get())

	v = c.AddAndGet(5)
	assert.Equal(t, int64(15), v)
	assert.Equal(t, int64(15), c.Get())
}
{'fraction_non_alphanumeric': 0.2053354890864996, 'fraction_numerical': 0.05982215036378335, 'mean_word_length': 4.576576576576577, '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': '2919476', 'n_tokens_mistral': 588, 'n_tokens_neox': 546, 'n_words': 96}