diff options
author | Alex Guerrieri <alex@tyba.com> | 2015-10-06 18:51:47 +0200 |
---|---|---|
committer | Alex Guerrieri <alex@tyba.com> | 2015-10-06 18:51:47 +0200 |
commit | 465cba710284204f9851854587c2887c247222db (patch) | |
tree | 75158b29f50acf928a069f4478852de51d77b466 /commons/hash_test.go | |
parent | b9471b13256703d3f5eb88b280b4a16ce325ec1b (diff) | |
download | go-git-465cba710284204f9851854587c2887c247222db.tar.gz |
Extract GitHash function
Diffstat (limited to 'commons/hash_test.go')
-rw-r--r-- | commons/hash_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/commons/hash_test.go b/commons/hash_test.go new file mode 100644 index 0000000..79a22ea --- /dev/null +++ b/commons/hash_test.go @@ -0,0 +1,12 @@ +package commons + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestCalculateHash(t *testing.T) { + assert.Equal(t, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", GitHash("blob", []byte(""))) + assert.Equal(t, "8ab686eafeb1f44702738c8b0f24f2567c36da6d", GitHash("blob", []byte("Hello, World!\n"))) +} |