unify-byte-counts #21

Merged
sashakoshka merged 16 commits from unify-byte-counts into main 2025-10-13 08:49:49 -06:00
Showing only changes of commit b2504cda2d - Show all commits

View File

@@ -2,8 +2,9 @@ package testutil
import "fmt"
import "slices"
import "strings"
import "reflect"
import "strings"
import "unicode"
// Snake lets you compare blocks of data where the ordering of certain parts may
// be swapped every which way. It is designed for comparing the encoding of
@@ -141,8 +142,16 @@ func (this *describer) describe(value reflect.Value) {
typ := value.Type()
for index := range typ.NumField() {
indexBuffer := [1]int { index }
this.iprintf("%s: ", typ.Field(index).Name)
this.describe(value.FieldByIndex(indexBuffer[:]))
field := typ.Field(index)
this.iprintf("%s: ", field.Name)
for _, char := range field.Name {
if unicode.IsUpper(char) {
this.describe(value.FieldByIndex(indexBuffer[:]))
} else {
this.printf("<private>")
}
break
}
this.iprintf("\n")
}
this.indent -= 1