mirror of
https://github.com/pcvolkmer/idicon.git
synced 2025-07-03 04:12:54 +00:00
Code cleanup
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user