Code cleanup

This commit is contained in:
2024-04-05 20:25:44 +02:00
parent 11cfa5a1eb
commit 16d569c457
5 changed files with 14 additions and 14 deletions

View File

@ -9,11 +9,11 @@ import (
func TestIgnoreCase(t *testing.T) {
w1 := bytes.NewBuffer([]byte{})
ig1 := NewIdIconGenerator().WithColorGenerator(ColorV1)
png.Encode(w1, ig1.GenIcon("example", 80))
_ = png.Encode(w1, ig1.GenIcon("example", 80))
w2 := bytes.NewBuffer([]byte{})
ig2 := NewIdIconGenerator().WithColorGenerator(ColorV1)
png.Encode(w2, ig2.GenIcon("Example", 80))
_ = png.Encode(w2, ig2.GenIcon("Example", 80))
if bytes.Compare(w1.Bytes(), w2.Bytes()) != 0 {
t.Errorf("resulting images do not match")
@ -24,11 +24,11 @@ func TestStringMatchesHash(t *testing.T) {
w1 := bytes.NewBuffer([]byte{})
ig1 := NewIdIconGenerator().WithColorGenerator(ColorV2)
// MD5 of lowercase 'example'
png.Encode(w1, ig1.GenIcon("1a79a4d60de6718e8e5b326e338ae533", 80))
_ = png.Encode(w1, ig1.GenIcon("1a79a4d60de6718e8e5b326e338ae533", 80))
w2 := bytes.NewBuffer([]byte{})
ig2 := NewIdIconGenerator().WithColorGenerator(ColorV2)
png.Encode(w2, ig2.GenIcon("Example", 80))
_ = png.Encode(w2, ig2.GenIcon("Example", 80))
if bytes.Compare(w1.Bytes(), w2.Bytes()) != 0 {
t.Errorf("resulting images do not match")