updated dependencies and go
This commit is contained in:
+3
-12
@@ -210,10 +210,7 @@ func diff(t *testing.T, a, b []byte) {
|
||||
t.Helper()
|
||||
for i := 0; ; i++ {
|
||||
if i >= len(a) || i >= len(b) || a[i] != b[i] {
|
||||
j := i - 10
|
||||
if j < 0 {
|
||||
j = 0
|
||||
}
|
||||
j := max(i-10, 0)
|
||||
t.Errorf("diverge at %d: «%s» vs «%s»", i, trim(a[j:]), trim(b[j:]))
|
||||
return
|
||||
}
|
||||
@@ -274,10 +271,7 @@ func genString(stddev float64) string {
|
||||
}
|
||||
|
||||
func genArray(n int) []any {
|
||||
f := int(math.Abs(rand.NormFloat64()) * math.Min(10, float64(n/2)))
|
||||
if f > n {
|
||||
f = n
|
||||
}
|
||||
f := min(int(math.Abs(rand.NormFloat64())*math.Min(10, float64(n/2))), n)
|
||||
if f < 1 {
|
||||
f = 1
|
||||
}
|
||||
@@ -289,10 +283,7 @@ func genArray(n int) []any {
|
||||
}
|
||||
|
||||
func genMap(n int) map[string]any {
|
||||
f := int(math.Abs(rand.NormFloat64()) * math.Min(10, float64(n/2)))
|
||||
if f > n {
|
||||
f = n
|
||||
}
|
||||
f := min(int(math.Abs(rand.NormFloat64())*math.Min(10, float64(n/2))), n)
|
||||
if n > 0 && f == 0 {
|
||||
f = 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user