<commit_before>package hash

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func Test_Hash(t *testing.T) {
	assert := assert.New(t)
	pass := "password"

	h, err := Hash(pass)
	assert.Nil(err, "hash should be successful")
	assert.Len(h, versionLength+latestConfig.hashLength+latestConfig.saltLength, "hash should be of the proper length")
	assert.True(Verify(pass, h), "password should be correct")

	c, err := newConfig(0)
	assert.Nil(c, "bogus version")
	assert.False(Verify("notpass", h), "incorrect password should fail")
	assert.False(Verify(pass, []byte{}), "passhash of incorrect length should be false")
}<commit_msg>Improve test messages<commit_after>package hash

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

func Test_Hash(t *testing.T) {
	assert := assert.New(t)
	pass := "password"

	h, err := Hash(pass)
	assert.Nil(err, "hash should be successful")
	assert.Len(h, versionLength+latestConfig.hashLength+latestConfig.saltLength, "hash should be of the proper length")
	assert.True(Verify(pass, h), "password should be correct")

	c, err := newConfig(0)
	assert.Nil(c, "bogus version should not produce config")
	assert.Error(err, "bogus version should error")
	assert.False(Verify("notpass", h), "incorrect password should fail")
	assert.False(Verify(pass, []byte{}), "passhash of incorrect length should be false")
}
{'fraction_non_alphanumeric': 0.14275202354672553, 'fraction_numerical': 0.0014716703458425313, 'mean_word_length': 5.8, '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': '1514136', 'n_tokens_mistral': 457, 'n_tokens_neox': 456, 'n_words': 123}