Revert gojson changes
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m34s

This commit is contained in:
2026-04-26 14:29:28 +02:00
parent d30e778bd4
commit 18c172d69a
6 changed files with 53 additions and 35 deletions
+12 -3
View File
@@ -210,7 +210,10 @@ 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 := max(i-10, 0)
j := i - 10
if j < 0 {
j = 0
}
t.Errorf("diverge at %d: «%s» vs «%s»", i, trim(a[j:]), trim(b[j:]))
return
}
@@ -271,7 +274,10 @@ func genString(stddev float64) string {
}
func genArray(n int) []any {
f := min(int(math.Abs(rand.NormFloat64())*math.Min(10, float64(n/2))), n)
f := int(math.Abs(rand.NormFloat64()) * math.Min(10, float64(n/2)))
if f > n {
f = n
}
if f < 1 {
f = 1
}
@@ -283,7 +289,10 @@ func genArray(n int) []any {
}
func genMap(n int) map[string]any {
f := min(int(math.Abs(rand.NormFloat64())*math.Min(10, float64(n/2))), n)
f := int(math.Abs(rand.NormFloat64()) * math.Min(10, float64(n/2)))
if f > n {
f = n
}
if n > 0 && f == 0 {
f = 1
}