Shorten processed image filenames

Fixes #12688
Fixes #12656
This commit is contained in:
Bjørn Erik Pedersen 2024-07-30 16:47:16 +02:00
parent e67886c038
commit 216a69a1ef
111 changed files with 77 additions and 73 deletions

View file

@ -17,6 +17,7 @@ import (
"fmt"
"math"
"strings"
"sync"
"testing"
qt "github.com/frankban/quicktest"
@ -32,6 +33,30 @@ func TestXxHashFromReader(t *testing.T) {
c.Assert(got, qt.Equals, uint64(7148569436472236994))
}
func TestXxHashFromReaderPara(t *testing.T) {
c := qt.New(t)
var wg sync.WaitGroup
for i := 0; i < 10; i++ {
i := i
wg.Add(1)
go func() {
defer wg.Done()
for j := 0; j < 100; j++ {
s := strings.Repeat("Hello ", i+j+1*42)
r := strings.NewReader(s)
got, size, err := XXHashFromReader(r)
c.Assert(size, qt.Equals, int64(len(s)))
c.Assert(err, qt.IsNil)
expect, _ := XXHashFromString(s)
c.Assert(got, qt.Equals, expect)
}
}()
}
wg.Wait()
}
func TestXxHashFromString(t *testing.T) {
c := qt.New(t)
s := "Hello World"